-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: Create channel modal not validating federated access permission #37504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 1991fa3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 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 |
WalkthroughReplaces previous license-module gating with an explicit boolean license flag plus permission check for federation in Create Channel modals; updates helper signature to accept the permission flag, adjusts UI hints/enabling, expands tests to cover federation permutations, and adds a changeset entry for a patch release. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
c9589fc to
545092e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #37504 +/- ##
===========================================
+ Coverage 67.68% 68.75% +1.07%
===========================================
Files 3457 3373 -84
Lines 113836 114197 +361
Branches 20909 20639 -270
===========================================
+ Hits 77050 78520 +1470
+ Misses 34652 33568 -1084
+ Partials 2134 2109 -25
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (1)
60-74: Consider sharinggetFederationHintKeyto avoid duplicationThe same
getFederationHintKeyimplementation appears in both this file and the sidebar header CreateChannel modal. Extracting it into a small shared helper (e.g., a hooks/util module) would reduce the chance of these diverging in future tweaks to hint behavior.apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
180-190: Make the first federation test robust by expanding the “Advanced settings” accordionAll other tests interacting with the federation/encryption toggles explicitly click
Advanced_settingsbefore querying the controls. This first federation test doesn’t, which makes it depend on the Accordion’s default open state.To keep the test consistent and robust against UI changes, consider adding:
await userEvent.click(screen.getByText('Advanced_settings'));before
getByLabelText('Federation_Matrix_Federated').
180-213: Optionally make the “no license module” test explicit about the feature flagRight now, the “user lacks license module” test relies on the default value of
Federation_Matrix_enabled. For clarity and to isolate the concern to licensing, you could explicitly set the feature flag totruein the wrapper (similar to the other tests).For example:
wrapper: mockAppRoot() .withSetting('Federation_Matrix_enabled', true) .build(),Not required for correctness, but it would make the intent clearer and avoid coupling to default settings.
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (1)
62-76: Same note on sharinggetFederationHintKeyAs in the NavBar modal, consider extracting
getFederationHintKeyinto a shared module so both create-channel entry points stay in lockstep when federation hint behavior changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/meteor/client/sidebar/header/CreateChannel/__snapshots__/CreateChannelModal.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (4)
.changeset/large-planes-destroy.md(1 hunks)apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx(4 hunks)apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx(2 hunks)apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx(4 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx.changeset/large-planes-destroy.mdapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
📚 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:
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
📚 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:
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx.changeset/large-planes-destroy.mdapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
🧬 Code graph analysis (3)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
packages/mock-providers/src/index.ts (1)
mockAppRoot(3-3)apps/meteor/tests/mocks/data.ts (1)
createFakeLicenseInfo(213-260)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (1)
packages/ui-contexts/src/index.ts (2)
TranslationKey(104-104)usePermission(55-55)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (1)
packages/ui-contexts/src/index.ts (2)
TranslationKey(104-104)usePermission(55-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (6)
.changeset/large-planes-destroy.md (1)
1-5: Changeset entry is clear and aligned with the PR scopeThe patch entry and description accurately describe the federation permission fix in the create channel modal. No changes needed.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (2)
24-31: Federation gating now correctly mirrors license, feature flag, and permission checksThe combination of:
usePermission('access-federation'),useHasLicenseModule('federation') === true, anduseIsFederationEnabled()into
canUseFederationplus the updatedgetFederationHintKeygives a clear and consistent UX:
- no license → premium feature error,
- feature disabled → disabled description,
- no permission → not-authorized error,
- all OK → normal description.
This matches the backend expectation that user-initiated federation actions require
access-federation, while still respecting license and workspace-level toggles. Based on learningsAlso applies to: 60-74, 90-94
301-322: Federation toggle accessibility and hint wiring look solidWiring the toggle’s
disabled={!canUseFederation}and the hint viaFieldHint+aria-describedby={${federatedId}-hint}ensures:
- users without license/feature/permission see an appropriate explanation, and
- assistive technologies surface the same reason via the accessible description.
This aligns well with the “immediate, clear feedback” objective for blocked federation actions.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
6-6: Federation tests cover the key license/feature/permission combinations wellThe new tests validating that the federated option is:
- disabled without the license module,
- disabled when the workspace feature flag is off,
- disabled when the user lacks
access-federation, and- enabled when all three conditions are satisfied,
provide good regression coverage for the new frontend gating and hint logic.
Also applies to: 180-260
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (2)
25-32: Consistent federation gating between NavBar and header modalsThis component’s changes mirror the NavBar create-channel modal: using
usePermission('access-federation')together with the license module anduseIsFederationEnabled()to computecanUseFederation, and deriving the hint via the updatedgetFederationHintKey.That keeps the federation UX consistent regardless of how the user opens the create-channel modal, while aligning with backend permission semantics. Based on learnings
Also applies to: 62-76, 94-98
305-323: Federation hint usage matches the new helper behaviorUsing
disabled={!canUseFederation}on the toggle andFieldHintwitht(federationFieldHint)(andaria-describedbypointing to the hint) ensures the user always sees—and assistive tech announces—the correct reason why federation is enabled or blocked.This matches the requirements for clear, context-specific feedback when federation is unavailable.
42548cb to
dacf8b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
183-193: Consider adding the accordion click for consistency.This test doesn't click
Advanced_settingsbefore accessing the federated toggle, unlike the other federation tests. While the element exists in the DOM regardless of accordion state, adding the click would improve test consistency and more accurately reflect user behavior.it('should render with federated option disabled when user lacks license module', async () => { render(<CreateChannelModal onClose={() => null} />, { wrapper: mockAppRoot().build(), }); + await userEvent.click(screen.getByText('Advanced_settings')); const federated = screen.getByLabelText('Federation_Matrix_Federated');apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (1)
62-76: Consider extractinggetFederationHintKeyto a shared utility.This function is duplicated identically in both
NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsxandsidebar/header/CreateChannel/CreateChannelModal.tsx. Extracting it to a shared hook or utility (e.g., alongsideuseIsFederationEnabled) would improve maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/meteor/client/sidebar/header/CreateChannel/__snapshots__/CreateChannelModal.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (4)
.changeset/large-planes-destroy.md(1 hunks)apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx(4 hunks)apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx(1 hunks)apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsxapps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
.changeset/large-planes-destroy.mdapps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
📚 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:
.changeset/large-planes-destroy.mdapps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
📚 Learning: 2025-11-05T21:04:35.787Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37357
File: ee/packages/federation-matrix/src/setup.ts:103-120
Timestamp: 2025-11-05T21:04:35.787Z
Learning: In Rocket.Chat's federation-matrix setup (ee/packages/federation-matrix/src/setup.ts and apps/meteor/ee/server/startup/federation.ts), configureFederationMatrixSettings does not need to be called before setupFederationMatrix. The SDK's init() establishes infrastructure (database, event handlers, APIs) first, and the configuration can be applied later via settings watchers before actual federation events are processed. The config only matters when events actually occur, at which point all infrastructure is already configured.
Applied to files:
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsxapps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
🧬 Code graph analysis (3)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
packages/mock-providers/src/index.ts (1)
mockAppRoot(3-3)apps/meteor/tests/mocks/data.ts (1)
createFakeLicenseInfo(213-260)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (3)
packages/ui-contexts/src/index.ts (2)
TranslationKey(106-106)usePermission(56-56)apps/meteor/client/hooks/useIsFederationEnabled.ts (1)
useIsFederationEnabled(3-8)apps/meteor/client/hooks/useHasLicenseModule.ts (1)
useHasLicenseModule(5-8)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (3)
packages/ui-contexts/src/index.ts (2)
TranslationKey(106-106)usePermission(56-56)apps/meteor/client/hooks/useIsFederationEnabled.ts (1)
useIsFederationEnabled(3-8)apps/meteor/client/hooks/useHasLicenseModule.ts (1)
useHasLicenseModule(5-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (6)
.changeset/large-planes-destroy.md (1)
1-5: LGTM!The changeset correctly describes the fix for validating federated access permission in the create channel modal.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (2)
60-74: LGTM!The
getFederationHintKeyfunction correctly implements the three-tier validation logic:
- License module check (premium feature)
- Feature toggle check (federation enabled)
- Permission check (access-federation)
The order is logical—checking license first, then feature enablement, then user permission.
89-94: LGTM!The federation gating logic correctly combines the license module check, feature toggle, and permission validation. The default value of
falseforfederationModuleensures safe behavior during loading states.Based on learnings, this frontend check mirrors the backend enforcement where user-initiated federation actions should validate the
access-federationpermission.apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
182-266: Good test coverage for federation permission scenarios.The test suite comprehensively covers all four paths in
getFederationHintKey:
- No license module → premium feature error
- Feature disabled → disabled description
- No permission → not-authorized error
- All conditions met → enabled state
The mocking approach using
createFakeLicenseInfoandwithPermissionis appropriate.apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (2)
62-76: LGTM!The
getFederationHintKeyimplementation correctly handles all three validation scenarios. The logic is identical to the NavBarV2 version.
92-97: LGTM!The federation gating logic is correctly implemented and consistent with the NavBarV2 version. The three-way AND condition (
federationModule && federationEnabled && federationAccessPermission) properly gates the federation toggle.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
12-12: Fix typo in test suite name.The describe block is misspelled as "Encription" instead of "Encryption".
Apply this diff:
- describe('Encription', () => { + describe('Encryption', () => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
🧬 Code graph analysis (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
packages/mock-providers/src/index.ts (1)
mockAppRoot(3-3)apps/meteor/tests/mocks/data.ts (1)
createFakeLicenseInfo(213-260)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (3)
6-6: LGTM!The import of
createFakeLicenseInfois correctly used throughout the federation tests to mock license information.
13-179: Comprehensive encryption test coverage!The encryption tests thoroughly cover various E2E settings, state transitions, and interactions with Private and Broadcast options. All tests properly click Advanced_settings and use appropriate web-first assertions.
195-265: Excellent federation permission-gating coverage!These tests properly validate the federation option behavior across different scenarios (feature disabled, permission missing, all conditions met), correctly using Advanced_settings expansion, license mocking, and accessible description assertions.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
🧬 Code graph analysis (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
packages/mock-providers/src/index.ts (1)
mockAppRoot(3-3)apps/meteor/tests/mocks/data.ts (1)
createFakeLicenseInfo(213-260)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (2)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (2)
13-179: Encryption test coverage is comprehensive.The tests effectively cover all E2E setting combinations and verify the interaction behavior between Private, Broadcast, and Encrypted toggles. The assertions correctly validate both initial states and state transitions.
182-267: Federation tests correctly validate the permission-gating behavior.The test suite comprehensively covers the federation access scenarios:
- License module absence (lines 183-194)
- Workspace feature disabled (lines 196-218)
- Missing user permission (lines 220-242) — key scenario from PR objectives
- All conditions satisfied (lines 244-266)
Each test verifies the appropriate accessible description, ensuring users receive contextual feedback about why federation is disabled.
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
183-194: Add user context for consistency with other federation tests.Test 1 doesn't use
.withJohnDoe()while all other federation tests (lines 196-266) do. Since the test name references "when user lacks license module," it should establish a user context to accurately test this scenario. Without it, the test may not reflect the intended behavior if the modal requires authentication.Apply this diff:
it('should render with federated option disabled when user lacks license module', async () => { render(<CreateChannelModal onClose={() => null} />, { - wrapper: mockAppRoot().build(), + wrapper: mockAppRoot().withJohnDoe().build(), }); await userEvent.click(screen.getByText('Advanced_settings'));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
🧠 Learnings (13)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
📚 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 descriptive test names that clearly communicate expected behavior in Playwright tests
Applied to files:
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
12-180: Comprehensive encryption test coverage.The encryption test suite thoroughly covers E2E setting combinations, toggle interactions, and state constraints. The tests follow consistent patterns with proper web-first assertions and user interactions.
Proposed changes (including videos or screenshots)
This PR adds an extra validation to the create channel modal to block the creation of federation channel when the user doesn't have the
access-federationpermission. We already validate this permission on the backend and now we are adding the same check to the frontend.Issue(s)
FB-28
FB-53
Steps to test or reproduce
access-federationfrom userFurther comments
Summary by CodeRabbit
Bug Fixes
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.