Skip to content

chore(deps): remove meteor-node-stubs#39818

Open
cardoso wants to merge 2 commits intodevelopfrom
rm-dep/meteor-node-stubs
Open

chore(deps): remove meteor-node-stubs#39818
cardoso wants to merge 2 commits intodevelopfrom
rm-dep/meteor-node-stubs

Conversation

@cardoso
Copy link
Copy Markdown
Member

@cardoso cardoso commented Mar 23, 2026

Removes 47 dependencies in total

Task: CORE-1993

Summary by CodeRabbit

  • Refactor

    • Improved cron expression parsing and validation with enhanced error handling for invalid or unreachable expressions.
  • Chores

    • Removed unused dependency from the application stack.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 23, 2026

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

  • This PR is targeting the wrong base branch. It should target 8.4.0, but it targets 8.3.0

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 23, 2026

⚠️ No Changeset found

Latest commit: a455365

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 23, 2026

Walkthrough

The pull request removes the meteor-node-stubs dependency from package.json and replaces the external cron library's sendAt implementation with a local parser that validates and iterates through 5-6 part cron expressions to find the next matching timestamp within a 5-year horizon.

Changes

Cohort / File(s) Summary
Local Cron Expression Parser
apps/meteor/client/hooks/usePruneWarningMessage.ts
Introduced local sendAt function to parse and validate 5-6 part cron expressions, supporting *, lists, ranges, and step values. Iteratively advances minute-by-minute from ~1 minute in future to find next match. Adds runtime errors for invalid/unreachable expressions.
Dependency Removal
apps/meteor/package.json
Removed meteor-node-stubs (~1.2.25) dependency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The usePruneWarningMessage.ts refactor introducing a custom sendAt function appears unrelated to the stated objective of removing meteor-node-stubs dependency. Clarify whether the cron parsing refactor is necessary for the meteor-node-stubs removal or split it into a separate PR for independent review.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(deps): remove meteor-node-stubs' accurately and concisely describes the primary change—removal of a dependency—matching the changeset.
Linked Issues check ✅ Passed The PR directly addresses the linked issue CORE-1993 by removing the meteor-node-stubs dependency from package.json and performing related cron import cleanup.
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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 92.59259% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.58%. Comparing base (1dbfce4) to head (a455365).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39818      +/-   ##
===========================================
- Coverage    70.61%   70.58%   -0.03%     
===========================================
  Files         3256     3256              
  Lines       115778   115831      +53     
  Branches     21042    21010      -32     
===========================================
+ Hits         81756    81764       +8     
- Misses       31965    32011      +46     
+ Partials      2057     2056       -1     
Flag Coverage Δ
e2e 60.42% <68.75%> (-0.02%) ⬇️
e2e-api 48.14% <ø> (-1.03%) ⬇️
unit 71.14% <92.59%> (+<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.

@cardoso cardoso added this to the 8.4.0 milestone Mar 23, 2026
@cardoso
Copy link
Copy Markdown
Member Author

cardoso commented Mar 23, 2026

/jira CORE-845

@cardoso cardoso marked this pull request as ready for review March 23, 2026 19:14
@cardoso cardoso requested a review from a team as a code owner March 23, 2026 19:14
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.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/hooks/usePruneWarningMessage.ts">

<violation number="1" location="apps/meteor/client/hooks/usePruneWarningMessage.ts:45">
P2: Cron month matching is off by one because `Date.getMonth()` is zero‑based. This will compute an incorrect next run month for expressions like `1` (January).</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/client/hooks/usePruneWarningMessage.ts`:
- Around line 45-56: The cron month comparison is off-by-one because
date.getMonth() returns 0–11; update the code in usePruneWarningMessage (where
curMonth is computed and later passed to match) to use a 1-indexed month (e.g.,
set curMonth = date.getMonth() + 1) so match(curMonth, month) compares against
cron's 1–12 values; ensure this single change is applied before the existing
match(curMinute, minute) && match(curHour, hour) && match(curMonth, month) &&
dayMatches check so all literal month values (like "1" or "12") evaluate
correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5382d158-d6f5-49b9-8bab-fd6f45016efb

📥 Commits

Reviewing files that changed from the base of the PR and between 1dbfce4 and a455365.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • apps/meteor/client/hooks/usePruneWarningMessage.ts
  • apps/meteor/package.json
💤 Files with no reviewable changes (1)
  • apps/meteor/package.json
📜 Review details
⏰ 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 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/client/hooks/usePruneWarningMessage.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 39690
File: packages/ui-voip/package.json:11-11
Timestamp: 2026-03-17T16:08:37.572Z
Learning: In `packages/ui-voip/package.json` (RocketChat/Rocket.Chat), the team deliberately chose to use `rm -rf dist` directly in the `"build"` script instead of `rimraf`, as they decided against introducing the `rimraf` dependency for this package. Do not flag `rm -rf dist` in the ui-voip build script as a cross-platform issue requiring rimraf.
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/client/hooks/usePruneWarningMessage.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/hooks/usePruneWarningMessage.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 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:

  • apps/meteor/client/hooks/usePruneWarningMessage.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:

  • apps/meteor/client/hooks/usePruneWarningMessage.ts
🔇 Additional comments (1)
apps/meteor/client/hooks/usePruneWarningMessage.ts (1)

12-64: Local sendAt implementation looks reasonable for current usage patterns.

The implementation correctly handles wildcards, comma lists, ranges, step values, and the day-of-week/day-of-month OR semantics. The 5-year iteration limit is a sensible safeguard.

A few notes for awareness:

  • Complex step patterns like 1-10/2 or 5/10 are not supported, but context shows only */n patterns are used.
  • Named months/days (e.g., JAN, MON) are not supported, which aligns with the documented "strict numeric format" requirement.

Aside from the month off-by-one issue flagged separately, the implementation is fit for current retention policy scheduling.

@cardoso cardoso added the stat: QA assured Means it has been tested and approved by a company insider label Mar 23, 2026
@cardoso cardoso modified the milestones: 8.4.0, 8.3.0 Mar 23, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 23, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge March 23, 2026 19:35
Copy link
Copy Markdown
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

your PR is going a little further than removing meteor-node-stubs, consider splitting them

@scuciatto scuciatto modified the milestones: 8.3.0, 8.4.0 Mar 24, 2026
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Mar 24, 2026
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 type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants