Skip to content

add missing radix parameter to parseInt#38541

Open
laky241 wants to merge 1 commit intoRocketChat:masterfrom
laky241:fix-parseint-radix-pagination
Open

add missing radix parameter to parseInt#38541
laky241 wants to merge 1 commit intoRocketChat:masterfrom
laky241:fix-parseint-radix-pagination

Conversation

@laky241
Copy link

@laky241 laky241 commented Feb 7, 2026

Fixed a bug in getPaginationItems() where parseInt() was called without specifying a radix parameter. This helper function is used by all API endpoints that support pagination.

If a user sends offset=08 or count=09 as query parameters, they could receive incorrect pagination results in older environments.
The Fix:
Added explicit radix parameter 10 to both parseInt()

Changed files:
apps/meteor/app/api/server/helpers/getPaginationItems.ts

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness of decimal number parsing in pagination handling to ensure consistent behavior across different numeric formats.

@laky241 laky241 requested a review from a team as a code owner February 7, 2026 17:47
@changeset-bot
Copy link

changeset-bot bot commented Feb 7, 2026

⚠️ No Changeset found

Latest commit: aefc1e7

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 7, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project
  • This PR has an invalid title

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Walkthrough

Adds explicit radix parameter (base 10) to two parseInt calls in the pagination helper function, ensuring robust decimal number parsing for offset and count values without altering functional behavior or public interfaces.

Changes

Cohort / File(s) Summary
Pagination Helper Robustness
apps/meteor/app/api/server/helpers/getPaginationItems.ts
Added explicit radix (10) parameter to two parseInt calls for offset and count parsing to ensure decimal base interpretation and prevent unintended hexadecimal parsing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A radix so fine, ten as the base,
No hex shall creep in this parsing place,
Two little tweaks, robust and true,
Pagination flows just as it should do!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add missing radix parameter to parseInt' directly summarizes the main change in the pull request—adding explicit radix parameters to parseInt calls in getPaginationItems.ts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7137ec8 and aefc1e7.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/helpers/getPaginationItems.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/helpers/getPaginationItems.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (2)
apps/meteor/app/api/server/helpers/getPaginationItems.ts (2)

15-15: LGTM — explicit radix prevents ambiguous parsing.

The addition of radix 10 ensures values like "08" or "09" are always parsed as decimal, which is the correct fix.


20-20: LGTM — consistent radix for count parsing.

Same correct fix applied to the count parameter.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants