feat: no egress for offline licenses - #41148
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 2685a1c The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe PR adds offline-license detection, blocks outbound cloud and external-service activity, suppresses related scheduled jobs, logs offline activation, and defers cron startup until after license application. ChangesOffline license enforcement
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ServerStartup
participant LicenseManager
participant CronJobs
participant RocketChatCloud
ServerStartup->>LicenseManager: apply and validate license
LicenseManager-->>ServerStartup: offline state available
ServerStartup->>CronJobs: start after license validation
CronJobs->>LicenseManager: hasOfflineLicense()
alt offline license
CronJobs-->>CronJobs: skip outbound task
else standard license
CronJobs->>RocketChatCloud: run scheduled cloud request
RocketChatCloud-->>CronJobs: response
end
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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 |
abf138a to
33a5964
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #41148 +/- ##
===========================================
- Coverage 68.56% 68.52% -0.04%
===========================================
Files 4124 4126 +2
Lines 160128 160228 +100
Branches 29166 29150 -16
===========================================
+ Hits 109788 109795 +7
- Misses 45240 45318 +78
- Partials 5100 5115 +15
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
61581aa to
27fdb55
Compare
4e2091d to
592d95d
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/meteor/ee/server/lib/license/startup.ts (1)
23-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the inline implementation comment.
The logging behavior is correct, but Line 24 adds a code comment inside the TypeScript implementation. Please remove it to follow the repository guidance; the
SystemLogger.startupcall is self-explanatory.As per coding guidelines, TypeScript/JavaScript implementations should avoid code comments.
🤖 Prompt for 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. In `@apps/meteor/ee/server/lib/license/startup.ts` around lines 23 - 27, Remove the inline comment above the SystemLogger.startup call in the !logged branch, leaving the existing logging behavior and message unchanged.Source: Coding guidelines
apps/meteor/server/lib/cloud/offlineLicense.ts (1)
5-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the implementation comments or relocate this contract.
The added JSDoc blocks conflict with the repository guideline to avoid code comments in TypeScript/JavaScript implementation files. Keep the guard behavior, but move the offline-egress contract to external developer documentation if it must be retained.
Also applies to: 17-20
🤖 Prompt for 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. In `@apps/meteor/server/lib/cloud/offlineLicense.ts` around lines 5 - 12, Remove the added JSDoc implementation comments around the offline-license guard in offlineLicense.ts while preserving the guard behavior unchanged. If the offline-egress contract must remain documented, relocate it to the appropriate external developer documentation instead of keeping it in the TypeScript implementation file.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@apps/meteor/ee/server/lib/license/startup.ts`:
- Around line 23-27: Remove the inline comment above the SystemLogger.startup
call in the !logged branch, leaving the existing logging behavior and message
unchanged.
In `@apps/meteor/server/lib/cloud/offlineLicense.ts`:
- Around line 5-12: Remove the added JSDoc implementation comments around the
offline-license guard in offlineLicense.ts while preserving the guard behavior
unchanged. If the offline-egress contract must remain documented, relocate it to
the appropriate external developer documentation instead of keeping it in the
TypeScript implementation file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e3c8e07-71f0-4897-be5a-d5551119d2a7
📒 Files selected for processing (31)
.changeset/offline-license-no-egress.mdapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/ee/server/lib/license/startup.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/startup/index.tsdocs/proposals/offline-license-capability-enforcement.mdee/packages/license/src/MockedLicenseBuilder.tsee/packages/license/src/license.spec.tsee/packages/license/src/license.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Hacktron Security Check
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.0 coverage (5/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.0 coverage (4/5)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsee/packages/license/src/license.spec.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/ee/server/lib/license/startup.tsee/packages/license/src/MockedLicenseBuilder.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsee/packages/license/src/license.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/server/startup/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:
ee/packages/license/src/license.spec.ts
🧠 Learnings (7)
📚 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/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsee/packages/license/src/license.spec.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/ee/server/lib/license/startup.tsee/packages/license/src/MockedLicenseBuilder.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsee/packages/license/src/license.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/server/startup/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:
apps/meteor/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsee/packages/license/src/license.spec.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/ee/server/lib/license/startup.tsee/packages/license/src/MockedLicenseBuilder.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsee/packages/license/src/license.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/server/startup/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:
apps/meteor/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsee/packages/license/src/license.spec.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/ee/server/lib/license/startup.tsee/packages/license/src/MockedLicenseBuilder.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsee/packages/license/src/license.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/server/startup/index.ts
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.
Applied to files:
.changeset/offline-license-no-egress.md
📚 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:
ee/packages/license/src/license.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:
ee/packages/license/src/license.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:
ee/packages/license/src/license.spec.ts
🪛 LanguageTool
docs/proposals/offline-license-capability-enforcement.md
[style] ~14-~14: You have already used ‘right’ in nearby sentences. Consider using an alternative word to let your writing stand out and sound more polished.
Context: ... right entitlement, or to happen at the right time. ## Proposed Solution Make every...
(REP_RIGHT)
[style] ~65-~65: To elevate your writing, try using an alternative expression here.
Context: ...mory; proofs are free to acquire, which matters for the per-attempt rule below. - **The...
(MATTERS_RELEVANT)
[style] ~112-~112: To strengthen your wording, consider replacing the phrasal verb “leave out”.
Context: ...; both were considered and deliberately left out in favor of a types-only approach.
(OMIT_EXCLUDE)
🔇 Additional comments (30)
ee/packages/license/src/license.ts (1)
456-458: LGTM!ee/packages/license/src/MockedLicenseBuilder.ts (1)
175-178: LGTM!ee/packages/license/src/license.spec.ts (1)
501-537: LGTM!apps/meteor/ee/server/lib/license/startup.ts (1)
147-148: LGTM!.changeset/offline-license-no-egress.md (1)
1-6: LGTM!docs/proposals/offline-license-capability-enforcement.md (1)
1-112: LGTM!apps/meteor/ee/server/apps/appRequestsCron.ts (1)
2-2: LGTM!Also applies to: 12-15
apps/meteor/ee/server/apps/cron.ts (1)
4-4: LGTM!Also applies to: 79-82
apps/meteor/server/main.ts (1)
14-14: LGTM!Also applies to: 31-36
apps/meteor/server/startup/index.ts (1)
20-22: LGTM!apps/meteor/lib/errors/CloudOfflineLicenseError.ts (1)
1-5: LGTM!apps/meteor/server/lib/cloud/connectWorkspace.ts (1)
4-4: LGTM!Also applies to: 51-51
apps/meteor/server/lib/cloud/getConfirmationPoll.ts (1)
4-4: LGTM!Also applies to: 9-9
apps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.ts (1)
6-6: LGTM!Also applies to: 11-12
apps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.ts (1)
6-6: LGTM!Also applies to: 10-13
apps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.ts (1)
5-5: LGTM!Also applies to: 9-10
apps/meteor/server/lib/cloud/finishOAuthAuthorization.ts (1)
7-13: LGTM!apps/meteor/server/lib/cloud/startRegisterWorkspace.ts (1)
5-5: LGTM!Also applies to: 14-15
apps/meteor/server/lib/cloud/syncWorkspace/index.ts (1)
4-4: LGTM!Also applies to: 16-21
apps/meteor/server/lib/cloud/userLogout.ts (1)
4-4: LGTM!Also applies to: 13-13
apps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.ts (1)
1-5: LGTM!Also applies to: 46-51
apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts (1)
19-19: LGTM!Also applies to: 259-260
apps/meteor/server/lib/users/getAvatarSuggestionForUser.ts (1)
8-8: LGTM!Also applies to: 105-113
apps/meteor/server/lib/cloud/getWorkspaceAccessToken.ts (1)
30-33: LGTM!apps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.ts (1)
35-38: LGTM!apps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.ts (1)
144-147: LGTM!apps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.ts (1)
47-50: LGTM!apps/meteor/server/lib/statistics/functions/sendUsageReport.ts (1)
44-77: LGTM!apps/meteor/server/lib/users/saveUser/saveNewUser.ts (1)
74-76: LGTM!apps/meteor/server/lib/notifications/push/push.ts (1)
405-411: 🎯 Functional CorrectnessNo issue:
gatewaysis only populated on the gateway-backed path, and that path leavesapn/gcmunset, so the offline-license guard does not skip configured native providers.> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
All reported issues were addressed across 31 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
5434bd1 to
271b65d
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/meteor/ee/server/apps/communication/rest.ts (1)
100-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsistently handle
CloudOfflineLicenseErroracross all marketplace endpoints.While
handleErrorcorrectly formatsCloudOfflineLicenseErrorto suppress error logs and return a clean failure reason, several other routes in this file that invoke marketplace requests (e.g., app installPOST, app updatePOST,/bundles/:id/apps,/app-request,/:id/sync, andbuildExternalUrl) do not use this helper forCloudOfflineLicenseError.Consider routing expected offline-license rejections through
handleErrorin these remaining endpoints as well. This will ensure that if an admin triggers them via the API while offline, the system returns a consistent, well-formed client message rather than generating unexpected 500 errors and spamming the logs with system errors.(Note: For the app install
POSTroute starting at line 269, the error is wrapped in aPromise.all.catch, so you may need to unwrap it by checking iferr.cause instanceof CloudOfflineLicenseError.)🤖 Prompt for 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. In `@apps/meteor/ee/server/apps/communication/rest.ts` around lines 100 - 106, The remaining marketplace endpoints should consistently route CloudOfflineLicenseError through handleError instead of treating it as an unexpected system failure. Update the app install and update POST handlers, /bundles/:id/apps, /app-request, /:id/sync, and buildExternalUrl error paths to invoke handleError; in the app install Promise.all catch, also detect err.cause instanceof CloudOfflineLicenseError. Preserve the existing clean failure response and suppressed logging behavior.
🤖 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 `@docs/proposals/offline-license-capability-enforcement.md`:
- Around line 85-89: Update the cloudFetch dispatch path and license-transition
coordination so validation and opening the serverFetch connection occur under an
atomic dispatch gate or equivalent blocking/cancellation mechanism, preventing
license changes from enabling egress after validation. Add a race test covering
a transition to offline between validation and dispatch, and verify the request
is not sent.
- Around line 112-114: Close the raw network-import bypass by enforcing that
server code uses the proof-checking cloudFetch boundary instead of importing
serverFetch directly. Add an appropriate no-restricted-imports rule or CI
validation, exempting the designated cloudClient.ts implementation (or otherwise
centralize the permitted network primitive), and ensure new code cannot bypass
offline-license revalidation.
---
Nitpick comments:
In `@apps/meteor/ee/server/apps/communication/rest.ts`:
- Around line 100-106: The remaining marketplace endpoints should consistently
route CloudOfflineLicenseError through handleError instead of treating it as an
unexpected system failure. Update the app install and update POST handlers,
/bundles/:id/apps, /app-request, /:id/sync, and buildExternalUrl error paths to
invoke handleError; in the app install Promise.all catch, also detect err.cause
instanceof CloudOfflineLicenseError. Preserve the existing clean failure
response and suppressed logging behavior.
🪄 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: eb989fa1-c1ae-477c-a6df-9c9a3de17340
📒 Files selected for processing (36)
.changeset/offline-license-no-egress.mdapps/meteor/ee/server/apps/appRequestsCron.tsapps/meteor/ee/server/apps/communication/rest.tsapps/meteor/ee/server/apps/cron.tsapps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.tsapps/meteor/ee/server/lib/license/startup.tsapps/meteor/lib/errors/CloudOfflineLicenseError.tsapps/meteor/server/lib/cloud/connectWorkspace.tsapps/meteor/server/lib/cloud/finishOAuthAuthorization.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.tsapps/meteor/server/lib/cloud/getWorkspaceAccessToken.tsapps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.tsapps/meteor/server/lib/cloud/offlineLicense.tsapps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.tsapps/meteor/server/lib/cloud/startRegisterWorkspace.tsapps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.tsapps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.tsapps/meteor/server/lib/cloud/syncWorkspace/index.tsapps/meteor/server/lib/cloud/userLogout.tsapps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.tsapps/meteor/server/lib/notifications/push/push.tsapps/meteor/server/lib/statistics/functions/sendUsageReport.tsapps/meteor/server/lib/users/getAvatarSuggestionForUser.tsapps/meteor/server/lib/users/saveUser/saveNewUser.tsapps/meteor/server/main.tsapps/meteor/server/modules/core-apps/cloudAnnouncements.module.tsapps/meteor/server/startup/index.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.tsapps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsdocs/proposals/offline-license-capability-enforcement.mdee/packages/license/src/MockedLicenseBuilder.tsee/packages/license/src/license.spec.tsee/packages/license/src/license.ts
🚧 Files skipped from review as they are similar to previous changes (29)
- apps/meteor/server/lib/cloud/connectWorkspace.ts
- apps/meteor/server/lib/cloud/finishOAuthAuthorization.ts
- ee/packages/license/src/license.spec.ts
- apps/meteor/server/lib/cloud/startRegisterWorkspaceSetupWizard.ts
- apps/meteor/lib/errors/CloudOfflineLicenseError.ts
- apps/meteor/server/lib/cloud/offlineLicense.ts
- ee/packages/license/src/MockedLicenseBuilder.ts
- apps/meteor/server/main.ts
- apps/meteor/ee/server/apps/appRequestsCron.ts
- apps/meteor/server/lib/cloud/userLogout.ts
- apps/meteor/server/lib/cloud/startRegisterWorkspace.ts
- apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts
- apps/meteor/server/lib/cloud/syncWorkspace/index.ts
- apps/meteor/server/lib/notifications/push/push.ts
- apps/meteor/server/lib/statistics/functions/sendUsageReport.ts
- apps/meteor/ee/server/apps/cron.ts
- apps/meteor/server/lib/cloud/registerPreIntentWorkspaceWizard.ts
- apps/meteor/ee/server/lib/license/startup.ts
- apps/meteor/server/startup/index.ts
- apps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.ts
- .changeset/offline-license-no-egress.md
- apps/meteor/server/lib/cloud/supportedVersionsToken/supportedVersionsToken.ts
- apps/meteor/ee/server/apps/marketplace/MarketplaceAPIClient.ts
- apps/meteor/server/lib/cloud/getWorkspaceAccessToken.ts
- apps/meteor/server/lib/users/saveUser/saveNewUser.ts
- apps/meteor/server/lib/users/getAvatarSuggestionForUser.ts
- apps/meteor/server/lib/cloud/getWorkspaceAccessTokenWithScope.ts
- ee/packages/license/src/license.ts
- apps/meteor/server/lib/cloud/version-check/functions/checkVersionUpdate.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: Hacktron Security Check
- GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/ee/server/apps/marketplace/fetchMarketplaceCategories.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.tsapps/meteor/ee/server/apps/communication/rest.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:
apps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.ts
🧠 Learnings (5)
📚 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/ee/server/apps/marketplace/fetchMarketplaceCategories.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.tsapps/meteor/ee/server/apps/communication/rest.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/ee/server/apps/marketplace/fetchMarketplaceCategories.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.tsapps/meteor/ee/server/apps/communication/rest.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:
apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.tsapps/meteor/server/lib/cloud/getConfirmationPoll.tsapps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.tsapps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.tsapps/meteor/ee/server/apps/communication/rest.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:
apps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.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:
apps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.tsapps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.ts
🪛 LanguageTool
docs/proposals/offline-license-capability-enforcement.md
[style] ~14-~14: You have already used ‘right’ in nearby sentences. Consider using an alternative word to let your writing stand out and sound more polished.
Context: ... right entitlement, or to happen at the right time. ## Proposed Solution Make every...
(REP_RIGHT)
[style] ~65-~65: To elevate your writing, try using an alternative expression here.
Context: ...mory; proofs are free to acquire, which matters for the per-attempt rule below. - **The...
(MATTERS_RELEVANT)
[style] ~114-~114: To strengthen your wording, consider replacing the phrasal verb “leave out”.
Context: ...; both were considered and deliberately left out in favor of a types-only approach.
(OMIT_EXCLUDE)
🔇 Additional comments (6)
docs/proposals/offline-license-capability-enforcement.md (1)
57-59: 🔒 Security & PrivacyFail closed while license state is unavailable.
proveCloudEgress()grants permission wheneverhasOfflineLicense()is false. If that method also returns false before license information is loaded or applied, startup calls can obtain egress permission during the exact window this proposal identifies. Define and test an explicit fail-closed initialization state, or verify thathasOfflineLicense()cannot returnfalsebefore licensing is resolved.apps/meteor/server/lib/cloud/getConfirmationPoll.ts (1)
4-10: LGTM!apps/meteor/ee/server/apps/marketplace/fetchMarketplaceApps.ts (1)
7-7: LGTM!Also applies to: 161-166
apps/meteor/ee/server/apps/marketplace/fetchMarketplaceCategories.ts (1)
7-7: LGTM!Also applies to: 45-50
apps/meteor/tests/unit/server/ee/apps/marketplace/MarketplaceAPIClient.spec.ts (1)
1-57: LGTM!apps/meteor/tests/unit/server/lib/cloud/registerPreIntentWorkspaceWizard.spec.ts (1)
1-64: LGTM!
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.ts (1)
63-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a test case for a missing
userId.Consider adding a test case to cover the new scenario where
userIdis empty or not provided, ensuring it correctly returns an empty string without invoking external calls.➕ Proposed test case
it('should do nothing when the workspace is not registered', async () => { retrieveRegistrationStatusStub.resolves({ workspaceRegistered: false }); const result = await userLogout('user-id'); expect(result).to.equal(''); expect(fetchStub.called).to.be.false; expect(userLoggedOutStub.called).to.be.false; }); + + it('should do nothing when the userId is empty', async () => { + retrieveRegistrationStatusStub.resolves({ workspaceRegistered: true }); + + const result = await userLogout(''); + + expect(result).to.equal(''); + expect(fetchStub.called).to.be.false; + expect(userLoggedOutStub.called).to.be.false; + }); });🤖 Prompt for 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. In `@apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.ts` around lines 63 - 72, Add a unit test alongside the existing userLogout tests covering an empty or omitted userId. Assert that userLogout returns an empty string and that fetchStub, retrieveRegistrationStatusStub, and userLoggedOutStub are not called.apps/meteor/server/lib/cloud/userLogout.ts (1)
21-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove code comments in the implementation.
As per coding guidelines, code comments in the implementation should be avoided.
♻️ Proposed refactor
- // Offline (air-gapped) licenses forbid the outbound token-revocation call, but - // the local cloud credentials must still be destroyed on logout. if (hasOfflineLicense()) { return userLoggedOut(userId); }🤖 Prompt for 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. In `@apps/meteor/server/lib/cloud/userLogout.ts` around lines 21 - 26, Remove the explanatory comment immediately above the hasOfflineLicense() branch in userLogout.ts, preserving the existing offline-license behavior that returns userLoggedOut(userId).Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@apps/meteor/server/lib/cloud/userLogout.ts`:
- Around line 21-26: Remove the explanatory comment immediately above the
hasOfflineLicense() branch in userLogout.ts, preserving the existing
offline-license behavior that returns userLoggedOut(userId).
In `@apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.ts`:
- Around line 63-72: Add a unit test alongside the existing userLogout tests
covering an empty or omitted userId. Assert that userLogout returns an empty
string and that fetchStub, retrieveRegistrationStatusStub, and userLoggedOutStub
are not called.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: feece5cf-6851-4c2e-b6eb-4e41284a4064
📒 Files selected for processing (2)
apps/meteor/server/lib/cloud/userLogout.tsapps/meteor/tests/unit/server/lib/cloud/userLogout.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: 📦 Build Packages
- GitHub Check: cubic · AI code reviewer
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/tests/unit/server/lib/cloud/userLogout.spec.tsapps/meteor/server/lib/cloud/userLogout.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:
apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.ts
🧠 Learnings (5)
📚 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:
apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.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/tests/unit/server/lib/cloud/userLogout.spec.tsapps/meteor/server/lib/cloud/userLogout.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/tests/unit/server/lib/cloud/userLogout.spec.tsapps/meteor/server/lib/cloud/userLogout.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:
apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.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:
apps/meteor/tests/unit/server/lib/cloud/userLogout.spec.tsapps/meteor/server/lib/cloud/userLogout.ts
🔇 Additional comments (1)
apps/meteor/server/lib/cloud/userLogout.ts (1)
13-19: LGTM!
835c0ff to
2685a1c
Compare
Proposed changes (including videos or screenshots)
Issue(s)
CORE-2370
Steps to test or reproduce
Further comments
This was extensively tested locally with network monitoring for more than 24h.
Summary by CodeRabbit