chore: migrate @rocket.chat/emitter from the Fuselage repository - #41768
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (18)
🚧 Files skipped from review as they are similar to previous changes (18)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
|
| Layer / File(s) | Summary |
|---|---|
Typed emitter implementation and tests packages/emitter/src/index.ts, packages/emitter/src/emitter.spec.ts |
Added typed event registration, one-time listeners, removal, emission, event queries, unsubscribe callbacks, and tests for listener behavior. |
Emitter package tooling
| Layer / File(s) | Summary |
|---|---|
Package build and publication setup packages/emitter/package.json, packages/emitter/rollup.config.mjs, packages/emitter/tsconfig.json, packages/emitter/tsconfig.build.json, packages/emitter/jest.config.ts, packages/emitter/CHANGELOG.md |
Added package metadata, CJS and ES builds, declaration output, Jest configuration, validation scripts, and changelog entries for versions 0.17.0 through 0.33.0. |
Workspace dependency updates
| Layer / File(s) | Summary |
|---|---|
Workspace dependency migration apps/meteor/.../package.json, apps/uikit-playground/package.json, ee/apps/*/package.json, ee/packages/*/package.json, packages/*/package.json |
Changed @rocket.chat/emitter dependencies and peer dependencies from published or unrestricted ranges to workspace:~. |
Bulk update command adjustment fuselage.sh |
Removed @rocket.chat/emitter from the packages listed and updated by the next-all and latest-all actions. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Mergeability Score: 🟡 Moderate · up to 77b2d
The migrated emitter may execute one-time listeners more than once when callbacks throw or trigger reentrant emission, potentially causing repeated side effects or recursive stack overflow. Merge should wait for this behavior to be fixed or explicitly accepted by the owner.
Possibly related PRs
- RocketChat/Rocket.Chat#41769: Migrates another Fuselage utility package into the monorepo and updates workspace references.
Suggested labels: type: feature
🚥 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 title clearly and concisely describes the primary change: migrating @rocket.chat/emitter into the Rocket.Chat repository. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| 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. |
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
Warning
Review ran into problems
🔥 Problems
Errors were encountered while retrieving linked issues.
Errors (2)
- ARCH-2354: Request failed with status code 401
- ARCH-2350: Request failed with status code 401
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.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/emitter/CHANGELOG.md`:
- Line 24: Update every affected section heading in the changelog, including the
`Features` heading and the referenced locations, from level-three (`###`) to
level-two (`##`) so they correctly nest beneath the level-one version headings
and satisfy MD001.
In `@packages/emitter/src/index.ts`:
- Around line 109-112: Update the event listener storage used by once, on, off,
and dispatch so each event tracks distinct { handler, once } registrations
rather than global handler-based one-time counters. During dispatch, remove a
one-time entry before invoking its handler, preserving separate persistent and
one-time registrations for the same function and ensuring throwing or reentrant
handlers cannot remain or run again. Add regression tests covering recursive
emission, thrown handlers, and shared handlers registered through both on and
once.
🪄 Autofix
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 Plus
Run ID: 5c697195-d351-4df7-9c53-f1982c57e4e6
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (36)
apps/meteor/ee/server/services/package.jsonapps/meteor/package.jsonapps/uikit-playground/package.jsonee/apps/account-service/package.jsonee/apps/authorization-service/package.jsonee/apps/ddp-streamer/package.jsonee/apps/omnichannel-transcript/package.jsonee/apps/presence-service/package.jsonee/apps/queue-worker/package.jsonee/packages/federation-matrix/package.jsonee/packages/media-calls/package.jsonee/packages/omnichannel-services/package.jsonfuselage.shpackages/ddp-client/package.jsonpackages/emitter/CHANGELOG.mdpackages/emitter/jest.config.tspackages/emitter/package.jsonpackages/emitter/rollup.config.mjspackages/emitter/src/emitter.spec.tspackages/emitter/src/index.tspackages/emitter/tsconfig.build.jsonpackages/emitter/tsconfig.jsonpackages/fuselage-ui-kit/package.jsonpackages/gazzodown/package.jsonpackages/livechat/package.jsonpackages/logger/package.jsonpackages/media-signaling/package.jsonpackages/mock-providers/package.jsonpackages/storybook-config/package.jsonpackages/ui-avatar/package.jsonpackages/ui-client/package.jsonpackages/ui-composer/package.jsonpackages/ui-contexts/package.jsonpackages/ui-video-conf/package.jsonpackages/ui-voip/package.jsonpackages/web-ui-registration/package.json
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Hacktron Security Check
- GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (4)
apps/meteor/**
📄 CodeRabbit inference engine (CLAUDE.md)
The main Rocket.Chat Meteor application resides in
apps/meteor/; place its application code there rather than in other monorepo areas.
Files:
apps/meteor/package.jsonapps/meteor/ee/server/services/package.json
packages/**
📄 CodeRabbit inference engine (CLAUDE.md)
Shared libraries belong in
packages/, while other services belong inapps/andee/.
Files:
packages/logger/package.jsonpackages/media-signaling/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonpackages/emitter/jest.config.tspackages/emitter/tsconfig.jsonpackages/emitter/CHANGELOG.mdpackages/emitter/tsconfig.build.jsonpackages/emitter/package.jsonpackages/emitter/rollup.config.mjspackages/emitter/src/emitter.spec.tspackages/storybook-config/package.jsonpackages/emitter/src/index.ts
**/*.{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/emitter/jest.config.tspackages/emitter/src/emitter.spec.tspackages/emitter/src/index.ts
**/*.spec.ts
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use.spec.tsextension for test files (e.g.,login.spec.ts)
Files:
packages/emitter/src/emitter.spec.ts
🧠 Learnings (44)
📓 Common learnings
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: 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: 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: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 40202
File: packages/ui-voip/package.json:12-12
Timestamp: 2026-06-19T20:51:30.340Z
Learning: In the `rocket.chat/ui-voip` package (`packages/ui-voip`), the `build:post` script runs `node --no-warnings dist/generate-landing-view.js`. Despite the TypeScript compiler being configured with `"module": "esnext"`, the `generate-landing-view.tsx` source uses CJS-compatible Node patterns (such as `createRequire`) rather than ESM-only constructs like `import.meta.url`. As a result, Node can execute the compiled output without requiring `"type": "module"` in `package.json`. Do not flag this as a module format mismatch — the build has been verified to work correctly.
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-08-06T23:50:03.764Z
Learning: Applies to apps/meteor/** : The main Rocket.Chat Meteor application resides in `apps/meteor/`; place its application code there rather than in other monorepo areas.
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: packages/apps-engine/turbo.json:6-6
Timestamp: 2026-04-14T23:23:18.990Z
Learning: In RocketChat/Rocket.Chat's Turborepo setup, the workspace-root `package.json` is part of Turbo's global hash and does not need to be explicitly listed in a package-level turbo.json task's `inputs` array. Changes to the root `package.json` already bust the cache for all tasks via the global hash. Do not flag the absence of `$TURBO_ROOT$/package.json` in task-level inputs as a cache-invalidation issue.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.
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-02-24T19:05:56.710Z
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.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonpackages/media-signaling/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonee/packages/federation-matrix/package.jsonee/apps/queue-worker/package.jsonfuselage.shee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-06-19T20:51:30.340Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 40202
File: packages/ui-voip/package.json:12-12
Timestamp: 2026-06-19T20:51:30.340Z
Learning: In the `rocket.chat/ui-voip` package (`packages/ui-voip`), the `build:post` script runs `node --no-warnings dist/generate-landing-view.js`. Despite the TypeScript compiler being configured with `"module": "esnext"`, the `generate-landing-view.tsx` source uses CJS-compatible Node patterns (such as `createRequire`) rather than ESM-only constructs like `import.meta.url`. As a result, Node can execute the compiled output without requiring `"type": "module"` in `package.json`. Do not flag this as a module format mismatch — the build has been verified to work correctly.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonpackages/media-signaling/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonee/packages/federation-matrix/package.jsonpackages/emitter/jest.config.tspackages/emitter/tsconfig.jsonpackages/emitter/tsconfig.build.jsonee/apps/queue-worker/package.jsonfuselage.shpackages/emitter/package.jsonpackages/emitter/rollup.config.mjsee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-03-17T16:08:37.572Z
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.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonpackages/media-signaling/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonfuselage.shee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonpackages/mock-providers/package.json
📚 Learning: 2026-04-14T23:23:18.990Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: packages/apps-engine/turbo.json:6-6
Timestamp: 2026-04-14T23:23:18.990Z
Learning: In RocketChat/Rocket.Chat's Turborepo setup, the workspace-root `package.json` is part of Turbo's global hash and does not need to be explicitly listed in a package-level turbo.json task's `inputs` array. Changes to the root `package.json` already bust the cache for all tasks via the global hash. Do not flag the absence of `$TURBO_ROOT$/package.json` in task-level inputs as a cache-invalidation issue.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonpackages/media-signaling/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonee/packages/federation-matrix/package.jsonee/apps/queue-worker/package.jsonee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-05-06T20:48:08.244Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: apps/meteor/app/apps/server/bridges/uiInteraction.ts:2-2
Timestamp: 2026-05-06T20:48:08.244Z
Learning: In the RocketChat/Rocket.Chat repository, Meteor's bundler does not respect the `exports` keyword in `package.json` files. Deep imports (e.g., `rocket.chat/apps/dist/server/bridges/UiInteractionBridge`) must be used instead of relying on `exports` subpath mappings. Do not suggest adding `exports` map entries to packages consumed by Meteor (e.g., `packages/apps/package.json`) as a fix for deep imports.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonpackages/media-signaling/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonee/packages/federation-matrix/package.jsonee/apps/queue-worker/package.jsonee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-02-24T19:09:09.561Z
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.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonee/apps/authorization-service/package.jsonapps/meteor/ee/server/services/package.json
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonee/apps/authorization-service/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonee/packages/federation-matrix/package.jsonpackages/emitter/tsconfig.jsonee/apps/queue-worker/package.jsonee/apps/account-service/package.json
📚 Learning: 2026-06-15T19:19:01.325Z
Learnt from: yasnagat
Repo: RocketChat/Rocket.Chat PR: 40950
File: package.json:167-168
Timestamp: 2026-06-15T19:19:01.325Z
Learning: In the RocketChat/Rocket.Chat monorepo's root `package.json`, the Yarn v4 resolution `"uuidnpm:13": "13.0.1"` is intentional. The lockfile resolves four uuid major versions simultaneously (8.3.2, 9.0.1, 11.1.1, 13.0.0) from different dependency chains. Using a bare `"uuid": "13.0.1"` would collapse all of them to v13, breaking packages that depend on ^8.x, ^9.x, and ~11.x. The descriptor-specific `npm:13` key syntax is required to pin only the v13 range without affecting other major version ranges.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonapps/uikit-playground/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonee/packages/federation-matrix/package.jsonee/apps/queue-worker/package.jsonfuselage.shee/apps/account-service/package.json
📚 Learning: 2026-02-24T19:05:56.710Z
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.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonpackages/logger/package.jsonee/apps/authorization-service/package.jsonapps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonee/apps/ddp-streamer/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonee/packages/media-calls/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonee/packages/federation-matrix/package.jsonee/apps/queue-worker/package.jsonfuselage.shee/apps/account-service/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-06-16T14:14:09.051Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/ui-video-conf/package.json:25-25
Timestamp: 2026-06-16T14:14:09.051Z
Learning: When reviewing rocket.chat/fuselage version bumps in the Rocket.Chat monorepo, do not flag version constraints as non-existent without verifying directly against the npm registry page (https://www.npmjs.com/package/rocket.chat/fuselage). Web search results for npm package versions can be stale and may not reflect the latest published releases.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonee/packages/omnichannel-services/package.jsonee/apps/presence-service/package.jsonapps/meteor/package.jsonee/apps/authorization-service/package.jsonapps/meteor/ee/server/services/package.jsonee/packages/federation-matrix/package.jsonpackages/emitter/CHANGELOG.mdee/apps/queue-worker/package.jsonfuselage.sh
📚 Learning: 2026-07-16T20:32:30.340Z
Learnt from: yasnagat
Repo: RocketChat/Rocket.Chat PR: 41427
File: package.json:105-106
Timestamp: 2026-07-16T20:32:30.340Z
Learning: In Rocket.Chat’s Yarn dependency management, keep `yarn.lock` entries’ `version:` fields aligned with `package.json` resolution overrides when possible: third-party security tools may parse the lockfile as plain text rather than evaluate Yarn’s resolution engine, causing false unresolved-CVE findings otherwise.
Applied to files:
ee/apps/omnichannel-transcript/package.jsonapps/meteor/package.jsonpackages/ddp-client/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonee/packages/federation-matrix/package.jsonfuselage.sh
📚 Learning: 2026-05-09T13:18:06.264Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40274
File: packages/models/src/models/Users.ts:1104-1107
Timestamp: 2026-05-09T13:18:06.264Z
Learning: In `packages/models/src/models/Users.ts` (RocketChat/Rocket.Chat), `updatePresenceAndStatus` intentionally uses the `BaseRaw.findOneAndUpdate` wrapper (which updates `_updatedAt`) because the method performs real document mutations (status claims, previousState, statusExpiresAt, etc.). Only `updateStatusById` deliberately bypasses `_updatedAt` via `this.col.updateOne` — specifically to use `_updatedAt` as a change-detection sentinel, not as a general "avoid churn" policy. Do not flag `updatePresenceAndStatus` for using the wrapper.
Applied to files:
ee/apps/presence-service/package.json
📚 Learning: 2026-08-06T23:50:03.764Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-08-06T23:50:03.764Z
Learning: Applies to apps/meteor/** : The main Rocket.Chat Meteor application resides in `apps/meteor/`; place its application code there rather than in other monorepo areas.
Applied to files:
apps/meteor/package.jsonapps/meteor/ee/server/services/package.jsonpackages/fuselage-ui-kit/package.json
📚 Learning: 2026-03-23T19:33:46.159Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 39818
File: apps/meteor/client/hooks/usePruneWarningMessage.ts:45-56
Timestamp: 2026-03-23T19:33:46.159Z
Learning: In RocketChat/Rocket.Chat, cron expressions used by the retention policy (e.g., `RetentionPolicy_Advanced_Precision_Cron`) follow the convention of the `cron` npm package (outdated version), which uses **0-indexed months** (0 = January, 11 = December), not the standard 1-12 used in POSIX cron. The local `sendAt` function in `apps/meteor/client/hooks/usePruneWarningMessage.ts` intentionally replicates this 0-indexed behavior. Do NOT suggest adding `+1` to `date.getMonth()` in this file, as it would break tests and create inconsistency with the backend.
Applied to files:
apps/meteor/package.json
📚 Learning: 2026-02-26T19:26:01.702Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:26:01.702Z
Learning: The RocketChat/Rocket.Chat project does not use Biome for linting, despite the presence of a biome.json file in the repository. Lint-related suggestions should not reference Biome rules.
Applied to files:
packages/logger/package.json
📚 Learning: 2026-06-16T14:13:34.463Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:31-31
Timestamp: 2026-06-16T14:13:34.463Z
Learning: In Rocket.Chat’s monorepo, when reviewing a dependency entry and flagging that a specific version “does not exist” (e.g., in package.json), first verify the exact package/version directly against the npm registry (use URLs like https://registry.npmjs.org/<package>/<version> or https://www.npmjs.com/package/<package>/v/<version>). Do not rely on web search results for this check, since they may be stale or cached and may not reflect the latest published versions.
Applied to files:
packages/logger/package.jsonpackages/media-signaling/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonpackages/emitter/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-06-16T14:13:49.795Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:26-26
Timestamp: 2026-06-16T14:13:49.795Z
Learning: During code reviews that check whether a dependency version exists in package.json (especially for Rocket.Chat’s rocket.chat/fuselage and related rocket.chat/fuselage-* packages), don’t rely on web search results. Instead, verify the version directly against the npm registry (e.g., via the npm registry API or the canonical package URL https://www.npmjs.com/package/<package>/v/<version>) before deciding that a version bump is invalid. If the version is present in the npm registry, do not flag it as invalid.
Applied to files:
packages/logger/package.jsonpackages/media-signaling/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonpackages/emitter/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-06-16T14:13:59.986Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/ui-video-conf/package.json:25-25
Timestamp: 2026-06-16T14:13:59.986Z
Learning: In the Rocket.Chat monorepo, when reviewing a dependency version bump for rocket.chat/fuselage in a package.json, do not flag the new version constraint as “non-existent” or invalid unless you verify the published versions directly from the npm registry (https://www.npmjs.com/package/rocket.chat/fuselage). Don’t rely on search/web results for available versions since they can be stale.
Applied to files:
packages/logger/package.jsonpackages/media-signaling/package.jsonpackages/ui-video-conf/package.jsonpackages/mock-providers/package.jsonpackages/ui-client/package.jsonpackages/ddp-client/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/web-ui-registration/package.jsonpackages/ui-voip/package.jsonpackages/livechat/package.jsonpackages/ui-contexts/package.jsonpackages/gazzodown/package.jsonpackages/ui-avatar/package.jsonpackages/ui-composer/package.jsonpackages/emitter/package.jsonpackages/storybook-config/package.json
📚 Learning: 2026-03-16T21:50:42.118Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:42.118Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs, removing endpoint types and validators from `rocket.chat/rest-typings` (e.g., `UserRegisterParamsPOST`, `/v1/users.register` entry) is the *required* migration pattern per RocketChat/Rocket.Chat-Open-API#150 Rule 7 ("No More rest-typings or Manual Typings"). The endpoint type is re-exposed via a module augmentation `.d.ts` file in the consuming package (e.g., `packages/web-ui-registration/src/users-register.d.ts`). This is NOT a breaking change — the correct changeset bump for `rocket.chat/rest-typings` in this scenario is `minor`, not `major`. Do not flag this as a breaking change during OpenAPI migration reviews.
Applied to files:
ee/apps/authorization-service/package.jsonpackages/web-ui-registration/package.json
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
packages/media-signaling/package.jsonpackages/mock-providers/package.jsonpackages/emitter/jest.config.tspackages/emitter/tsconfig.build.json
📚 Learning: 2026-03-06T18:09:17.867Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/elements/Timestamp/DateTimeFormats.spec.tsx:20-23
Timestamp: 2026-03-06T18:09:17.867Z
Learning: In the RocketChat/Rocket.Chat gazzodown package (`packages/gazzodown`), tests are intended to run under the UTC timezone, but as of PR `#39397` this is NOT yet explicitly enforced in `jest.config.ts` or the `package.json` test scripts (which just run `jest` without `TZ=UTC`). To make timezone-sensitive snapshot tests reliable across all environments, `TZ=UTC` should be added to the test scripts in `package.json` or to `jest.config.ts` via `testEnvironmentOptions.timezone`. Without explicit UTC enforcement, snapshot tests involving date-fns formatted output or `toLocaleString()` will fail for contributors in non-UTC timezones.
Applied to files:
packages/media-signaling/package.jsonpackages/mock-providers/package.jsonpackages/emitter/jest.config.ts
📚 Learning: 2026-06-18T21:15:00.821Z
Learnt from: abhinavkrin
Repo: RocketChat/Rocket.Chat PR: 41009
File: apps/meteor/tests/end-to-end/apps/apps-update.ts:27-39
Timestamp: 2026-06-18T21:15:00.821Z
Learning: In Rocket.Chat's Apps Engine, the app update API does not check or enforce version constraints. When writing E2E tests for app updates (e.g., in apps/meteor/tests/end-to-end/apps/apps-update.ts), it is valid and intentional to install and update using the same version fixture (e.g., appUpdateTest v0.0.1 for both install and update). Do not flag same-version update tests as missing a realistic version upgrade scenario.
Applied to files:
apps/meteor/ee/server/services/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/ui-contexts/package.jsonfuselage.sh
📚 Learning: 2026-05-11T21:46:26.540Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40463
File: packages/apps/src/lib/SecureFields.ts:17-19
Timestamp: 2026-05-11T21:46:26.540Z
Learning: In `RocketChat/Rocket.Chat`, the package `packages/apps` (`packages/apps/tsconfig.json`) has `"strict": false` set in its TypeScript compiler options. This means `noImplicitAny` and other strict checks are disabled, so indexing `unknown` (e.g., `object?.[kSecureFields]`) does NOT produce TS7053. Do not flag TS7053 or related strict-mode errors for files under `packages/apps/src/`.
Applied to files:
apps/meteor/ee/server/services/package.jsonpackages/ui-video-conf/package.jsonpackages/fuselage-ui-kit/package.jsonpackages/emitter/tsconfig.jsonpackages/emitter/tsconfig.build.json
📚 Learning: 2026-03-06T18:02:20.381Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/elements/Timestamp/RelativeTime.spec.tsx:63-70
Timestamp: 2026-03-06T18:02:20.381Z
Learning: In RocketChat/Rocket.Chat, tests in the `packages/gazzodown` package (and likely the broader test suite) are always expected to run in the UTC timezone. This makes `toLocaleString()` output deterministic, so snapshot tests that include locale/timezone-sensitive content (such as `title` attributes from `toLocaleString()`) are stable and do not need to be replaced with targeted assertions.
Applied to files:
packages/mock-providers/package.json
📚 Learning: 2026-02-10T16:32:49.806Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:49.806Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON which automatically deserializes Date objects. Stream handlers (e.g., sdk.stream()) receive Date fields as Date objects directly and do not require manual conversion using `new Date()`. Only REST API responses require manual date conversion because they return plain JSON where dates are serialized as strings.
Applied to files:
ee/apps/ddp-streamer/package.json
📚 Learning: 2026-05-06T20:49:27.193Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts:15-15
Timestamp: 2026-05-06T20:49:27.193Z
Learning: In the RocketChat/Rocket.Chat repository, the ExternalComponents feature (related to IExternalComponentRoomInfo, IExternalComponentUserInfo, and IExternalComponentState in packages/apps-engine/src/definition/externalComponent/) is deprecated and unreachable. Do not flag performance or API design concerns for code in this feature area.
Applied to files:
packages/livechat/package.jsonpackages/ui-avatar/package.json
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
ee/packages/federation-matrix/package.json
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.
Applied to files:
ee/packages/federation-matrix/package.json
📚 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/emitter/jest.config.tspackages/emitter/src/emitter.spec.tspackages/emitter/src/index.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/emitter/jest.config.tspackages/emitter/src/emitter.spec.tspackages/emitter/src/index.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.
Applied to files:
packages/emitter/jest.config.tspackages/emitter/src/emitter.spec.tspackages/emitter/src/index.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)
Applied to files:
packages/emitter/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/emitter/tsconfig.build.json
📚 Learning: 2026-03-14T14:58:58.834Z
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.
Applied to files:
fuselage.sh
📚 Learning: 2026-06-16T14:13:59.294Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:26-26
Timestamp: 2026-06-16T14:13:59.294Z
Learning: When verifying whether a specific npm package version exists, the npm registry API or the direct npm package URL (https://www.npmjs.com/package/<package>/v/<version>) is more reliable than a web search, which may return cached or stale results. For rocket.chat/fuselage and related fuselage packages in the RocketChat/Rocket.Chat monorepo, always verify version availability directly from the npm registry before flagging a version bump as invalid.
Applied to files:
fuselage.sh
📚 Learning: 2026-06-16T14:13:38.765Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:31-31
Timestamp: 2026-06-16T14:13:38.765Z
Learning: In the Rocket.Chat monorepo, when flagging a dependency version as non-existent, always verify directly against the npm registry (e.g., https://registry.npmjs.org/<package>/<version> or https://www.npmjs.com/package/<package>/v/<version>) before raising an issue. Web search results can return stale or cached data that does not reflect the latest published versions.
Applied to files:
fuselage.sh
📚 Learning: 2025-11-16T19:09:43.823Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37496
File: packages/apps-engine/tests/server/runtime/deno/LivenessManager.spec.ts:3-3
Timestamp: 2025-11-16T19:09:43.823Z
Learning: In Node.js, `EventEmitter` can be imported from either the 'events' module or the 'stream' module—both export the same reference. While 'events' is the canonical module, importing from 'stream' is valid and works correctly.
Applied to files:
packages/emitter/package.jsonpackages/emitter/src/index.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
packages/emitter/src/emitter.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
packages/emitter/src/emitter.spec.ts
📚 Learning: 2025-12-10T21:00:43.645Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:43.645Z
Learning: Adopt the monorepo-wide Jest testMatch pattern: <rootDir>/src/**/*.spec.{ts,js,mjs} (represented here as '**/src/**/*.spec.{ts,js,mjs}') to ensure spec files under any package's src directory are picked up consistently across all packages in the Rocket.Chat monorepo. Apply this pattern in jest.config.ts for all relevant packages to maintain uniform test discovery.
Applied to files:
packages/emitter/src/emitter.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.
Applied to files:
packages/emitter/src/emitter.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.
Applied to files:
packages/emitter/src/emitter.spec.ts
🪛 markdownlint-cli2 (0.23.2)
packages/emitter/CHANGELOG.md
[warning] 24-24: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 30-30: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 40-40: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 55-55: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 61-61: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 67-67: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 73-73: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 79-79: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
[warning] 111-111: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
🔇 Additional comments (33)
apps/meteor/ee/server/services/package.json (1)
22-22: LGTM!apps/meteor/package.json (1)
108-108: LGTM!apps/uikit-playground/package.json (1)
43-43: LGTM!ee/apps/account-service/package.json (1)
24-24: LGTM!packages/mock-providers/package.json (1)
19-19: LGTM!packages/storybook-config/package.json (1)
22-22: LGTM!packages/ui-avatar/package.json (1)
19-19: LGTM!packages/ui-client/package.json (1)
28-28: LGTM!packages/ui-composer/package.json (1)
24-24: LGTM!packages/ui-contexts/package.json (1)
25-25: LGTM!Also applies to: 49-49
ee/apps/authorization-service/package.json (1)
25-25: LGTM!ee/apps/omnichannel-transcript/package.json (1)
25-25: LGTM!ee/apps/presence-service/package.json (1)
25-25: LGTM!ee/apps/queue-worker/package.json (1)
24-24: LGTM!ee/packages/federation-matrix/package.json (1)
24-24: LGTM!packages/ui-video-conf/package.json (1)
21-21: LGTM!packages/ui-voip/package.json (1)
24-24: LGTM!packages/web-ui-registration/package.json (1)
25-25: LGTM!ee/apps/ddp-streamer/package.json (1)
25-25: LGTM!ee/packages/media-calls/package.json (1)
20-20: LGTM!ee/packages/omnichannel-services/package.json (1)
22-22: LGTM!packages/ddp-client/package.json (1)
36-36: LGTM!fuselage.sh (1)
112-112: LGTM!Also applies to: 125-125
packages/fuselage-ui-kit/package.json (1)
48-48: LGTM!packages/gazzodown/package.json (1)
32-32: LGTM!packages/livechat/package.json (1)
31-31: LGTM!packages/logger/package.json (1)
17-17: LGTM!packages/media-signaling/package.json (1)
32-32: LGTM!packages/emitter/package.json (1)
1-50: LGTM!packages/emitter/tsconfig.json (1)
1-10: LGTM!packages/emitter/tsconfig.build.json (1)
1-8: LGTM!packages/emitter/rollup.config.mjs (1)
1-32: LGTM!packages/emitter/jest.config.ts (1)
1-6: LGTM!
There was a problem hiding this comment.
All reported issues were addressed across 37 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
dc946a1 to
2df3092
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #41768 +/- ##
========================================
Coverage 69.04% 69.05%
========================================
Files 4224 4225 +1
Lines 166113 166160 +47
Branches 29547 29595 +48
========================================
+ Hits 114691 114738 +47
- Misses 46260 46264 +4
+ Partials 5162 5158 -4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Adds the package as a workspace under `packages/emitter`, carrying over its source, tests, build config and changelog at version 0.33.0. Consumers still declare `^0.33.0` and keep resolving to the published npm package; switching them over to the workspace is a follow-up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces the vendored tsconfig with `@rocket.chat/tsconfig/base.json` and the `ts-jest` preset with `@rocket.chat/jest-presets/server`, keeping `target`/`lib` at ES2024 so the emitted bundle is unchanged. Drops the `json`, `nodeResolve` and `commonjs` rollup plugins: `src/index.ts` has no imports, so all three were no-ops. Collapses `dir`/`entryFileNames` into `file`, and relies on terser's defaults for `compress`/`mangle`. Declaration emit moves to `tsconfig.build.json`, the only config that emits; `tsc --noEmit` and the editor ignore those options. Output verified byte-identical to the previous build, except that sourcemaps now inline `sourcesContent` — the maps point at `../src/index.ts`, which is not in the published tarball, so they were previously unusable for consumers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Points every first-party dependant at `workspace:~` instead of the published `^0.33.0`, and drops the package from the `fuselage.sh` bulk-upgrade list now that it is no longer sourced from the registry. `@rocket.chat/federation-sdk` and `@rocket.chat/fuselage-forms` still pull the npm build transitively, so the lockfile keeps that resolution. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Without a `volta` block, volta stops at the nearest `package.json` and falls back to the ambient toolchain instead of walking up to the root pin, so commands run in this package picked up whatever Node happened to be active — `yarn build` failed outright with a Node 22.22.3 engines mismatch. Matches the `extends` block used by 71 of the other 74 workspace packages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`@rocket.chat/federation-sdk` and `@rocket.chat/fuselage-forms` depend on `@rocket.chat/emitter@^0.33.0`, which the workspace copy satisfies at 0.33.0. With transparent workspaces on — Yarn's default — a fresh resolution folds that descriptor into the workspace, but incremental installs kept the stale registry pin because the descriptor was already resolved. Hardened mode re-resolves from scratch and rejected the mismatch: YN0078: Invalid resolution @rocket.chat/emitter@npm:^0.33.0 → npm:0.33.0 CI enables it (`HARDENED_MODE: '1'`), so this failed there. Re-resolving drops the duplicate registry copy and leaves a single emitter in the tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
77b2d8e
062db14 to
77b2d8e
Compare
Proposed changes (including videos or screenshots)
@rocket.chat/emitteris the first package in the Fuselage migration — a leaf with no internal dependencies, so it can go first. This PR moves it here as a workspace package, adopts the repo's shared configs, and flips every first-party consumer off the registry.Three commits do the work, and they are worth reading in order:
chore: absorb @rocket.chat/emitter from the fuselage repo— the package lands atpackages/emitterwith its source, spec, build config and changelog, at version0.33.0. Noworkspacesglob entry was needed: the rootpackage.jsonalready globspackages/*.dist/and.turbo/are gitignored, so only the eight source files are tracked. At this point nothing consumes it — every dependant still resolved to the published package.chore(emitter): adopt shared configs and simplify the rollup setup— the vendored config is replaced with the repo's own:tsconfig.jsonextends@rocket.chat/tsconfig/base.json, keepingtarget/libat ES2024. That base setstarget: es5, which silently doubled the bundle (631 → 1238 bytes,classlowered to prototype assignments plus aSuppressedErrorhelper), so restating it is load-bearing. The base also carries nodeclaration, which droppedindex.d.tswhile"types"still pointed at it — restored, and scoped totsconfig.build.json, the only config that emits.jest.config.tsuses@rocket.chat/jest-presets/serverin place of the rawts-jestpreset.src/index.tshas no imports at all, sojson(),nodeResolve()andcommonjs()had nothing to act on.dir+entryFileNamescollapse intofile, which also drops thenode:pathimport, andcompress/mangleare terser's defaults.tersermoves aftertypescript, where it reads correctly — it only hooksrenderChunk, so this is cosmetic.The emitted bundle is unchanged. See Steps to test for how that was checked.
chore: consume @rocket.chat/emitter from the workspace— 28 dependency entries across 27package.jsonfiles move from^0.33.0(and two*peer ranges) toworkspace:~, andfuselage.shstops bumping the package now that it no longer comes from the registry.Issue(s)
ARCH-2354
Steps to test or reproduce
Nothing changes for the user — same code, same consumers, and the published bundle is byte-for-byte what
0.33.0already ships.yarn workspace @rocket.chat/emitter build— then comparedist/against a build of the pre-migration config.index.js,index.module.js,index.d.tsandindex.d.ts.mapare byte-identical; the two sourcemaps match onversion,file,sources,namesandmappings. The only difference issourcesContent, covered below.yarn workspace @rocket.chat/emitter testunit— 11 tests, 1 suite, ~92% statement coverage.typecheckandlintare clean.yarn workspace @rocket.chat/logger typecheck— clean, which is the real check on the switchover: it resolves@rocket.chat/emittertopackages/emitter/dist/index.jsand only typechecks because the declarations were restored in commit 2.node_modules/@rocket.chat/emittershould be a symlink to../../packages/emitter, not a directory.Further comments
Sourcemaps now inline their sources. This is the one intentional output change. The old config set
inlineSources: false, so the published maps carriedsourcesContent: [null]and pointed at../src/index.ts— a path that is not in the tarball, sincefilesis["/dist"]. The maps were therefore unusable for consumers. They now embed the source (~5KB) and actually resolve. Easy to revert by restoringinlineSources: falseandsourceMap: trueif we would rather keep the bytes identical.No API report. The ticket specifies
rollup -c && api-extractor run --localand API report: yes. There is no api-extractor config, dependency oretc/report anywhere in this repo, so honouring that would mean introducing the tool to Rocket.Chat rather than carrying a convention across. I left the build asrollup -c. If the API report matters for this package, it should be its own task covering the tooling for all migrated packages, not a one-off here.Consumers use
workspace:~, notworkspace:^. The ticket says^.~matches how the surrounding packages pin their internal workspace dependencies, so I followed the local convention; happy to flip it if the migration plan depends on^.The transitive range now resolves to the workspace, and that is load-bearing for CI.
@rocket.chat/federation-sdk@0.7.0and@rocket.chat/fuselage-forms@~1.5.1depend on@rocket.chat/emitter@^0.33.0, which the workspace copy satisfies at0.33.0. With transparent workspaces on — Yarn's default — a fresh resolution folds that descriptor into the workspace, but incremental installs kept the stale registry pin, since an already-resolved descriptor is never re-resolved. Hardened mode does re-resolve from scratch and rejected the mismatch:CI enables it (
HARDENED_MODE: '1'inci.yml), so this failed there until the lockfile was regenerated. The upside is that the duplicate copy is gone — there is now a single emitter in the tree, and those two packages link against the workspace build.One thing to keep in mind: this holds only while
packages/emitterstays inside^0.33.0. Bumping it to0.34.0would put it outside that range, restore the registry copy, and reintroduce exactly this failure — so that bump needs a lockfile regeneration in the same commit.npm trusted publishing still needs repointing. As the ticket notes, the publisher is bound to
RocketChat/fuselage+.github/workflows/cd.yml. That is an npm UI change by an org owner and cannot be done from this repo. It is not exercised until the Rocket.Chat publish pipeline lands (ARCH-2350), but it should not be forgotten.No changeset yet. This changes the declared dependencies of 27 publishable packages, and bumping
@rocket.chat/emitteris a versioning call for a package this repo is now publishing itself — flagging it rather than picking the bumps unilaterally.Summary by CodeRabbit
New Features
Documentation
Tests
Chores