Skip to content

Conversation

@dougfabris
Copy link
Member

@dougfabris dougfabris commented Sep 30, 2025

Proposed changes (including videos or screenshots)

This PR fixes an issue where its possible to initiate a video call in archived rooms

Issue(s)

Steps to test or reproduce

  • Enable and configure video conference feature
  • Go to any archived room
  • Try to initiate a video call
  • The start call button should be disabled

Further comments

CORE-1339

Summary by CodeRabbit

  • Bug Fixes

    • Video call start is disabled in archived rooms; tooltip reflects the disabled state.
  • Tests

    • Added end-to-end tests to verify video call behavior in archived channels.
    • Added test utilities to create archived channels and updated setup/teardown for cleanup.
  • Chores

    • Added a changeset entry documenting the patch.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 30, 2025

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

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

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 97484bf

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

This PR includes changesets to release 42 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/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/federation-service 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/ui-voip 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

@dougfabris dougfabris added this to the 7.12.0 milestone Sep 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds an archived-room check to the video-call action disabling logic, introduces a test utility to create and archive a channel, and extends video-conference e2e tests to cover the archived-channel scenario (setup/teardown and a test asserting the video call button is disabled).

Changes

Cohort / File(s) Summary
Client: Video call action state
apps/meteor/client/hooks/roomActions/useVideoCallRoomAction.tsx
Adds archived-room check to the disabled calculation for the video call action so archived rooms report disabled = true (tooltip follows existing disabled flow).
E2E Utils: Channel setup
apps/meteor/tests/e2e/utils/create-target-channel.ts
Adds createArchivedChannel(api) which creates a channel, archives it via POST /channels.archive, validates presence of a name, and returns the channel name or throws descriptive errors.
E2E Tests: Video conference
apps/meteor/tests/e2e/video-conference.spec.ts
Imports and uses createArchivedChannel; manages targetArchivedChannel lifecycle in setup/teardown; adds a test ensuring the video call button is disabled in archived channels; updates related test titles/descriptions.
Changeset
.changeset/sixty-ladybugs-heal.md
Adds changeset documenting patch to prevent starting calls in archived rooms.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Client UI (Room)
  participant Hook as useVideoCallRoomAction
  participant Store as Room State Store

  User->>UI: Open room
  UI->>Hook: Request video-call action state
  Hook->>Store: Read room flags (archived, federated, folder/perm readonly)
  alt room.archived or other disable conditions
    Hook-->>UI: disabled = true (tooltip via disabled flow)
    UI-->>User: Video call button shown disabled
  else
    Hook-->>UI: disabled = false
    User->>UI: Click video call
    UI->>Server: Initiate call
    Server-->>UI: Call started
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • MartinSchoeler

Poem

In burrows where the old chats sleep,
The archived doors are closed and deep.
No video hops, no ringing bell—
I nibble logs and guard it well. 🐇📵

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR successfully disables the video call button and adds tests for video conferencing in archived rooms, but it does not address disabling voice call initiation or include tests for voice calls, leaving the linked issue’s requirement of preventing all new calls incompletely implemented. Add logic to disable the voice call action hook in archived rooms and include E2E tests verifying that voice call initiation is also prevented.
✅ 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 “fix: Prevent video calls from being started in archived rooms” succinctly captures the main change of disabling video call initiation in archived rooms, directly reflecting the added condition in useVideoCallRoomAction.tsx and corresponding test updates.
Out of Scope Changes Check ✅ Passed All modifications—including the disabled condition in the video call hook, the new createArchivedChannel utility, and updated tests—directly serve the goal of preventing call initiation in archived rooms, with no unrelated changes present.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/initiate-call-archived

📜 Recent 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 24d5583 and 97484bf.

📒 Files selected for processing (1)
  • .changeset/sixty-ladybugs-heal.md (1 hunks)
⏰ 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). (6)
  • GitHub Check: check
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 📦 Meteor Build - coverage
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

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

❤️ Share

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

@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.38%. Comparing base (affd1ac) to head (97484bf).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37109   +/-   ##
========================================
  Coverage    67.37%   67.38%           
========================================
  Files         3330     3330           
  Lines       113482   113482           
  Branches     20601    20605    +4     
========================================
+ Hits         76464    76470    +6     
+ Misses       34408    34402    -6     
  Partials      2610     2610           
Flag Coverage Δ
e2e 57.33% <100.00%> (+0.02%) ⬆️
unit 71.15% <ø> (-0.01%) ⬇️

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

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

@dougfabris dougfabris marked this pull request as ready for review October 1, 2025 01:41
@dougfabris dougfabris requested a review from a team as a code owner October 1, 2025 01:41
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: 2

🧹 Nitpick comments (2)
apps/meteor/tests/e2e/utils/create-target-channel.ts (2)

107-111: Improve error message interpolation.

The error handling uses ${error} which may produce unhelpful output like [object Object]. Consider using ${error?.message} or ${String(error)} for better error visibility during test failures.

Apply this diff:

 	} catch (error) {
-		throw new Error(`Error archiving the channel: ${error}`);
+		throw new Error(`Error archiving the channel: ${error instanceof Error ? error.message : String(error)}`);
 	}

113-115: Validation occurs after archive operation.

The channel name validation happens after the channel is archived. If the validation fails, an archived channel remains in the system. Consider validating channel.name immediately after line 105, before the archive operation.

Apply this diff:

 export async function createArchivedChannel(api: BaseTest['api']): Promise<string> {
 	const { channel } = await createTargetChannelAndReturnFullRoom(api);
 
+	if (!channel.name) {
+		throw new Error('Invalid channel was created');
+	}
+
 	try {
 		await api.post('/channels.archive', { roomId: channel._id });
 	} catch (error) {
 		throw new Error(`Error archiving the channel: ${error instanceof Error ? error.message : String(error)}`);
 	}
 
-	if (!channel.name) {
-		throw new Error('Invalid channel was created');
-	}
-
 	return channel.name;
 }
📜 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 affd1ac and 8e4e40f.

📒 Files selected for processing (3)
  • apps/meteor/client/hooks/roomActions/useVideoCallRoomAction.tsx (1 hunks)
  • apps/meteor/tests/e2e/utils/create-target-channel.ts (1 hunks)
  • apps/meteor/tests/e2e/video-conference.spec.ts (6 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/utils/create-target-channel.ts
  • apps/meteor/tests/e2e/video-conference.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/utils/create-target-channel.ts
  • apps/meteor/tests/e2e/video-conference.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/video-conference.spec.ts (1)
apps/meteor/tests/e2e/utils/create-target-channel.ts (6)
  • createTargetChannel (11-16)
  • createArchivedChannel (104-118)
  • createTargetTeam (59-64)
  • createDirectMessage (70-74)
  • deleteChannel (44-46)
  • deleteTeam (66-68)
🔇 Additional comments (5)
apps/meteor/client/hooks/roomActions/useVideoCallRoomAction.tsx (1)

53-53: LGTM!

The addition of room.archived to the disabled condition correctly prevents video calls from being initiated in archived rooms, directly addressing the issue described in CORE-1339.

apps/meteor/tests/e2e/video-conference.spec.ts (4)

4-12: LGTM!

The import of createArchivedChannel is correctly added and the import structure follows the existing pattern.


22-22: LGTM!

Variable declaration follows the existing pattern and naming convention.


28-28: LGTM!

Archived channel creation in beforeAll follows the existing setup pattern.


33-40: LGTM!

The cleanup properly deletes the archived channel using Promise.all for efficient parallel cleanup.

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/tests/e2e/video-conference.spec.ts (1)

69-69: Remove unnecessary async from test.describe() callbacks.

The test.describe() blocks at lines 69, 87, and 119 have async () callbacks, but describe blocks do not need to be async in Playwright. The async keyword serves no purpose here and deviates from standard Playwright patterns.

Apply this diff to remove the unnecessary async keywords:

-	test.describe('video conference message block', async () => {
+	test.describe('video conference message block', () => {
-	test.describe('verify if user2 received a invite call in targetChannel', async () => {
+	test.describe('verify if user2 received a invite call in targetChannel', () => {
-	test.describe('verify if user2 received from a targetTeam', async () => {
+	test.describe('verify if user2 received from a targetTeam', () => {

Also applies to: 87-87, 119-119

📜 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 8e4e40f and 24d5583.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/video-conference.spec.ts (6 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/meteor/tests/e2e/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
🧠 Learnings (3)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (e.g., toBeVisible, toHaveText)

Applied to files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements

Applied to files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently

Applied to files:

  • apps/meteor/tests/e2e/video-conference.spec.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/video-conference.spec.ts (1)
apps/meteor/tests/e2e/utils/create-target-channel.ts (6)
  • createTargetChannel (11-16)
  • createArchivedChannel (104-118)
  • createTargetTeam (59-64)
  • createDirectMessage (70-74)
  • deleteChannel (44-46)
  • deleteTeam (66-68)
⏰ 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). (7)
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 📦 Meteor Build - coverage
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (6)
apps/meteor/tests/e2e/video-conference.spec.ts (6)

4-12: LGTM!

The import of createArchivedChannel is correctly added and used in the test setup.


22-22: LGTM!

The targetArchivedChannel variable follows the existing naming convention and is properly scoped.


28-28: LGTM!

The archived channel is correctly created in the setup phase using the appropriate helper function.


33-40: LGTM!

The cleanup is properly implemented with parallel execution via Promise.all, and correctly includes the new archived channel. This ensures test isolation as per coding guidelines.

[Based on coding guidelines]


143-147: LGTM!

The test correctly uses the web-first .toBeDisabled() assertion to verify the video call button is disabled in read-only channels.

[Based on coding guidelines]


149-153: LGTM! Test correctly implements the PR objective.

The test properly verifies that users cannot initiate video calls from archived rooms, directly addressing issue CORE-1339. The web-first .toBeDisabled() assertion is correctly used as per coding guidelines.

[Based on coding guidelines]

@aleksandernsilva aleksandernsilva added the stat: QA assured Means it has been tested and approved by a company insider label Oct 1, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 1, 2025
@kodiakhq kodiakhq bot merged commit c2e9949 into develop Oct 1, 2025
111 of 115 checks passed
@kodiakhq kodiakhq bot deleted the fix/initiate-call-archived branch October 1, 2025 17:54
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.

3 participants