Skip to content

Conversation

@aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Nov 13, 2025

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-federation permission. 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

  • Remove access-federation from user
  • Create new > Channel
  • Advanced settings
  • Federation option should be disabled.
  • Federation option hint should inform that the user doesn't have access

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Create channel modal now properly validates federated access, gates the federation toggle, and shows correct messaging when federation is unlicensed, disabled, or the user lacks permission.
  • Tests

    • Expanded automated tests for federation scenarios (license, feature flag, permission) and extended encryption-related combinations and transitions.
  • Chores

    • Added changeset entry for a patch release.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 13, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: 1991fa3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

Replaces 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

Cohort / File(s) Summary
Changeset Metadata
\.changeset/large-planes-destroy.md
Adds a changeset documenting a patch release for @rocket.chat/meteor and notes the fix: create channel modal now validates federated access permission.
NavBarV2 CreateChannelModal
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx
Adds usePermission import; reads federationModule via destructured useHasLicenseModule('federation'); obtains federationAccessPermission with usePermission('access-federation'); computes canUseFederation = federationModule && federationEnabled && federationAccessPermission; updates getFederationHintKey signature to accept the permission flag and uses a precomputed federationFieldHint.
Sidebar CreateChannelModal
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
Mirrors NavBar changes: import usePermission, destructure useHasLicenseModule('federation'), compute federationAccessPermission and canUseFederation, update getFederationHintKey signature and use new hint value in rendering.
Create Channel Modal Tests
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx
Adds createFakeLicenseInfo test helper; reorganizes encryption tests; introduces a new Federation test suite covering absent license module, disabled feature toggle, missing access-federation permission, and enabled+permitted scenarios using mocks and assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • Ensure all call sites updated to the new getFederationHintKey signature.
    • Verify destructuring/defaulting of useHasLicenseModule('federation') doesn't hide loading/pending semantics.
    • Confirm usePermission('access-federation') semantics and that canUseFederation correctly gates UI and hint selection.
    • Validate new tests and mocks for completeness and flakiness risk.

Possibly related PRs

Suggested labels

stat: ready to merge

Suggested reviewers

  • ggazzo
  • dougfabris

Poem

🐇 I hopped through gates of license and perm,
Checked every flag, made the UI firm.
Hints now whisper who may roam,
Channels safer, no surprise at home.
A tiny hop — a steady change.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR directly addresses FB-53 by validating access-federation permission in the Create Channel modal frontend. FB-28's requirements for UI feedback on disabled/expired federation are partially addressed through the hint mechanism but not fully implemented. Verify whether the permission denial hint in the Create Channel modal satisfies FB-28's requirement for clear feedback, or if additional composer-level blocking is needed for other federation scenarios.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding federated access permission validation to the Create Channel modal.
Out of Scope Changes check ✅ Passed All changes focus on adding access-federation permission validation to the Create Channel modal and related test updates, directly aligned with the stated objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/create-fed-room-without-permission

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aleksandernsilva aleksandernsilva force-pushed the fix/create-fed-room-without-permission branch from c9589fc to 545092e Compare November 14, 2025 12:52
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.75%. Comparing base (733c94b) to head (1991fa3).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 57.38% <33.33%> (+0.05%) ⬆️
e2e-api 43.24% <ø> (+0.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aleksandernsilva aleksandernsilva marked this pull request as ready for review November 14, 2025 17:24
@aleksandernsilva aleksandernsilva requested a review from a team as a code owner November 14, 2025 17:24
@aleksandernsilva aleksandernsilva added this to the 7.13.0 milestone Nov 14, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (1)

60-74: Consider sharing getFederationHintKey to avoid duplication

The same getFederationHintKey implementation 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” accordion

All other tests interacting with the federation/encryption toggles explicitly click Advanced_settings before 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 flag

Right 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 to true in 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 sharing getFederationHintKey

As in the NavBar modal, consider extracting getFederationHintKey into 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 7d90c9d and 42548cb.

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/sidebar/header/CreateChannel/__snapshots__/CreateChannelModal.spec.tsx.snap is 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.md
  • apps/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.tsx
  • apps/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.md
  • apps/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 scope

The 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 checks

The combination of:

  • usePermission('access-federation'),
  • useHasLicenseModule('federation') === true, and
  • useIsFederationEnabled()

into canUseFederation plus the updated getFederationHintKey gives 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 learnings

Also applies to: 60-74, 90-94


301-322: Federation toggle accessibility and hint wiring look solid

Wiring the toggle’s disabled={!canUseFederation} and the hint via FieldHint + 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 well

The 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 modals

This component’s changes mirror the NavBar create-channel modal: using usePermission('access-federation') together with the license module and useIsFederationEnabled() to compute canUseFederation, and deriving the hint via the updated getFederationHintKey.

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 behavior

Using disabled={!canUseFederation} on the toggle and FieldHint with t(federationFieldHint) (and aria-describedby pointing 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.

@scuciatto scuciatto modified the milestones: 7.13.0, 7.14.0 Nov 25, 2025
@aleksandernsilva aleksandernsilva force-pushed the fix/create-fed-room-without-permission branch from 42548cb to dacf8b7 Compare November 28, 2025 15:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 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_settings before 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 extracting getFederationHintKey to a shared utility.

This function is duplicated identically in both NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx and sidebar/header/CreateChannel/CreateChannelModal.tsx. Extracting it to a shared hook or utility (e.g., alongside useIsFederationEnabled) 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 42548cb and dacf8b7.

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/sidebar/header/CreateChannel/__snapshots__/CreateChannelModal.spec.tsx.snap is 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.tsx
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
  • apps/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.md
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
  • apps/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.md
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
  • apps/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.tsx
  • apps/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.tsx
  • apps/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 getFederationHintKey function correctly implements the three-tier validation logic:

  1. License module check (premium feature)
  2. Feature toggle check (federation enabled)
  3. 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 false for federationModule ensures safe behavior during loading states.

Based on learnings, this frontend check mirrors the backend enforcement where user-initiated federation actions should validate the access-federation permission.

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:

  1. No license module → premium feature error
  2. Feature disabled → disabled description
  3. No permission → not-authorized error
  4. All conditions met → enabled state

The mocking approach using createFakeLicenseInfo and withPermission is appropriate.

apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (2)

62-76: LGTM!

The getFederationHintKey implementation 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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 358MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +924B
queue-worker-service 132MiB 132MiB -506B
ddp-streamer-service 126MiB 126MiB +1020B
account-service 113MiB 113MiB -169B
stream-hub-service 110MiB 110MiB 0B
authorization-service 110MiB 110MiB +571B
presence-service 110MiB 110MiB +279B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 03:51", "12/16 13:18 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 22 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37504
  • Baseline: develop
  • Timestamp: 2025-12-16 13:18:34 UTC
  • Historical data points: 22

Updated: Tue, 16 Dec 2025 13:18:35 GMT

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 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.

📥 Commits

Reviewing files that changed from the base of the PR and between dacf8b7 and 8ecf5a6.

📒 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 createFakeLicenseInfo is 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 8ecf5a6 and 209f695.

📒 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.

@aleksandernsilva aleksandernsilva added the stat: QA assured Means it has been tested and approved by a company insider label Dec 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 16, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Dec 16, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 209f695 and 1991fa3.

📒 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.

@aleksandernsilva aleksandernsilva added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Dec 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 16, 2025
@kodiakhq kodiakhq bot merged commit be679f4 into develop Dec 16, 2025
55 checks passed
@kodiakhq kodiakhq bot deleted the fix/create-fed-room-without-permission branch December 16, 2025 14:02
gaolin1 pushed a commit to gaolin1/medsense.webchat that referenced this pull request Jan 6, 2026
@dougfabris dougfabris modified the milestones: 7.14.0, 8.0.0 Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants