Visitar URL original
fix: declare `listitem` in poplib's STAT handler by tassoevan · Pull Request #43333 · RocketChat/Rocket.Chat · GitHub
Skip to content

fix: declare listitem in poplib's STAT handler - #43333

Merged
dionisio-bot[bot] merged 1 commit into
developfrom
fix/poplib-stat-listitem
Oct 30, 2026
Merged

dionisio-bot[bot] merged 1 commit into
developfrom
fix/poplib-stat-listitem

Conversation

@tassoevan

@tassoevan tassoevan commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

The STAT response handler in @rocket.chat/poplib assigned listitem without declaring it, so every stat() call wrote listitem onto the global object. It only works because the file runs in sloppy mode; in strict mode the assignment throws and stat() breaks.

The variable is now declared with var, as the LIST and UIDL handlers already do. stat() returns the same { count, octets } as before.

No changeset, since the change isn't user-visible.

Issue(s)

ARCH-2641

Steps to test or reproduce

Call stat() on a logged-in POP3Client. It returns the message count and size, and globalThis.listitem stays undefined.

Further comments

What I verified: against a fake POP3 server answering +OK 3 1234, stat() returns {"count":"3","octets":"1234"} both before and after the change. Before it, listitem leaked onto globalThis; after it, it doesn't. node --check passes. The package has no lint or test scripts, so neither ran.

🤖 Generated with Claude Code

View guided diff

Summary by CodeRabbit

  • Bug Fixes
    • Improved the handling of POP3 statistics responses. The reported message count and total message size continue to be parsed as before, with no change to the information shown to users.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tassoevan tassoevan added this to the 9.1.0 milestone Oct 30, 2026
@dionisio-bot

dionisio-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 864476f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

View guided diff | Re-trigger cubic

@tassoevan
tassoevan requested a review from a team October 30, 2026 03:15
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The stat method now declares listitem locally when parsing a successful response. The parsing and trimming of count and octets remain unchanged.

Changes

POP3 stat parsing

Layer / File(s) Summary
Declare the response parsing variable locally
packages/node-poplib/src/index.js
The successful-response branch now declares listitem locally. The parsed count and octets values and their trimming remain unchanged.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Suggested labels: type: bug

Suggested reviewers: ggazzo

Merge Risk: Minimal · up to 86447

The focused fix is low risk and preserves existing STAT behavior.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: declaring listitem in the POP3 STAT handler.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors: 1
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.41%. Comparing base (8083485) to head (864476f).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #43333      +/-   ##
===========================================
+ Coverage    72.40%   72.41%   +0.01%     
===========================================
  Files         5393     5393              
  Lines       232776   232776              
  Branches     44510    44558      +48     
===========================================
+ Hits        168533   168576      +43     
+ Misses       59729    59664      -65     
- Partials      4514     4536      +22     
Flag Coverage Δ
e2e 62.67% <ø> (+0.01%) ⬆️
e2e-api 49.25% <ø> (+0.28%) ⬆️
unit 72.20% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Oct 30, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 30, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into develop with commit 141f39f Oct 30, 2026
70 checks passed
@dionisio-bot
dionisio-bot Bot deleted the fix/poplib-stat-listitem branch October 30, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants