Skip to content

fix(message-parser): correct parameter types for timestampFromIsoTime#39405

Closed
amitpamnani205 wants to merge 1 commit intoRocketChat:developfrom
amitpamnani205:fix-timestamp-iso-types
Closed

fix(message-parser): correct parameter types for timestampFromIsoTime#39405
amitpamnani205 wants to merge 1 commit intoRocketChat:developfrom
amitpamnani205:fix-timestamp-iso-types

Conversation

@amitpamnani205
Copy link
Copy Markdown
Contributor

@amitpamnani205 amitpamnani205 commented Mar 6, 2026

Summary

The timestampFromIsoTime function defined parameters as string[], but the PEG parser grammar passes plain string values using join().

Changes

Updated the parameter types from string[] to string to match the actual usage.

Impact

Improves type correctness in the message parser without changing runtime behavior.

Fixes #39375

Summary by CodeRabbit

  • Refactor
    • Internal optimization of timestamp parsing utility to improve code maintainability. No changes to user-facing functionality.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Mar 6, 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

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: 9ef563d

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 46ebcbda-1193-4bdc-994b-28747df87336

📥 Commits

Reviewing files that changed from the base of the PR and between 46a1774 and 9ef563d.

📒 Files selected for processing (1)
  • packages/message-parser/src/utils.ts
📜 Recent review details
🧰 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:

  • packages/message-parser/src/utils.ts
🧠 Learnings (2)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/message-parser/src/utils.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/message-parser/src/utils.ts
🔇 Additional comments (1)
packages/message-parser/src/utils.ts (1)

293-299: Type signature now matches the parser contract.

These parameter types now align with the PEG call site and with the string interpolation used to build the ISO timestamp here. Nice targeted fix.


Walkthrough

Updated the timestampFromIsoTime function parameter types in the message parser utility from string arrays to individual strings, correcting a type mismatch between the function signature and its actual usage throughout the codebase.

Changes

Cohort / File(s) Summary
Type Signature Correction
packages/message-parser/src/utils.ts
Modified timestampFromIsoTime function to accept scalar string parameters (year, month, day, hours, minutes, seconds, milliseconds?) instead of string arrays, aligning the function signature with how it is actually invoked.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix(message-parser): correct parameter types for timestampFromIsoTime' accurately describes the main change—updating parameter types from string[] to string.
Linked Issues check ✅ Passed The PR directly addresses issue #39375 by correcting the parameter types of timestampFromIsoTime from string[] to string, matching the actual usage in the grammar.
Out of Scope Changes check ✅ Passed All changes in the PR are scoped to fixing the parameter types of timestampFromIsoTime in utils.ts, directly aligned with the objectives in issue #39375.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the 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
Copy Markdown
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

@ggazzo
Copy link
Copy Markdown
Member

ggazzo commented Apr 17, 2026

Hey @amitpamnani205, thank you for your contribution! 🙏

Your changes have been consolidated into #39853, where we merged all message-parser PRs together to make it easier to test and validate everything as a single unit.

That PR has already been merged into develop, so your work is included. Closing this one — thanks again!

@ggazzo ggazzo closed this Apr 17, 2026
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.

Wrong parameter types for timestampFromIsoTime in message parser

2 participants