Skip to content

Conversation

@gabriellsh
Copy link
Member

@gabriellsh gabriellsh commented Oct 27, 2025

Proposed changes (including videos or screenshots)

Issue(s)

VGA-57

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • User autocomplete endpoint now includes voice call extension information in results.
  • Tests

    • Enhanced test coverage and improved test execution efficiency.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 27, 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 Oct 27, 2025

🦋 Changeset detected

Latest commit: 6fa5102

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 Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@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 Major
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@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 Major
@rocket.chat/ui-voip Major
@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

coderabbitai bot commented Oct 27, 2025

Walkthrough

The changes add the freeSwitchExtension field to the users.autocomplete endpoint projection, enabling voice call extension data in autocomplete results. Supporting modifications include test improvements with explicit HTTP status checks, new EE-gated test cases validating the filtering capability, and test setup optimizations using parallel operations.

Changes

Cohort / File(s) Summary
Changeset
.changeset/wicked-chairs-compete.md
Documents a minor version bump for @rocket.chat/meteor with the addition of voice call extension to users.autocomplete endpoint
API Projection
apps/meteor/app/api/server/lib/users.ts
Adds freeSwitchExtension field to the projection in findUsersToAutocomplete to include voice call extension data in autocomplete results
Test Infrastructure
apps/meteor/tests/data/users.helper.ts
Adds explicit HTTP 200 status check to the createUser endpoint request chain for improved error handling
End-to-End Tests
apps/meteor/tests/end-to-end/api/users.ts
Refactors test setup with parallel operations using Promise.all for user creation and login; makes before hooks asynchronous; adds new EE-gated test case for freeSwitchExtension filtering; standardizes async test completion with .end(done)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • End-to-end tests (users.ts): Multiple interrelated changes across test setup, hooks, and new test cases require careful verification of async/parallel logic and proper EE flag gating
  • Test helper changes (users.helper.ts): Ensure the HTTP 200 check doesn't mask legitimate failure scenarios elsewhere in the test suite
  • API projection: Verify freeSwitchExtension field is correctly populated from the data layer and accessible to all autocomplete consumers

Poem

🐰 A voice extension blooms within our call,
Now hopping through autocomplete's hall—
With freeSwitchExtension in sight,
Tests run parallel, swift and bright!
Extension data, returned at last,
Our features echo, voices vast! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning While the core change—adding freeSwitchExtension to the autocomplete response—is directly in scope, the pull request includes several test file refactorings that appear tangential to the main objective. Specifically, apps/meteor/tests/end-to-end/api/users.ts contains changes to parallelize user creation and login using Promise.all, consolidate cleanup in after hooks, make before hooks asynchronous, and standardize .end(done) patterns. These general test improvements and optimizations, while potentially beneficial, do not appear strictly necessary to implement the voice call extension feature and may represent scope creep. The HTTP 200 expectation added to users.helper.ts is minor but also appears incidental to the main feature. Consider isolating the core feature changes (adding freeSwitchExtension to the projection and the corresponding test for filtering) into this pull request, and address the test infrastructure refactoring (Promise.all parallelization, async before hooks, cleanup consolidation, and .end(done) standardization) in a separate pull request. This would maintain focus on the specific feature being delivered and make the change history clearer for future reference. If these refactorings are prerequisite changes needed for the new test to function correctly, explicitly document that dependency in the PR description.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat: Add voice call extension to users.autocomplete endpoint" clearly and specifically describes the main change in the changeset. The title accurately reflects the primary modification—adding the freeSwitchExtension field to the users.autocomplete API response—as evidenced by the changes to the projection in users.ts and the corresponding test updates that verify this functionality. The title is concise, uses appropriate semantic versioning prefix, and would allow teammates scanning history to understand the core change at a glance.
Linked Issues Check ✅ Passed The linked issue VGA-57 specifies the objective to modify the users.autocomplete API response to include voice call extension data. The pull request fulfills this requirement by adding the freeSwitchExtension field to the projection in the findUsersToAutocomplete function in apps/meteor/app/api/server/lib/users.ts, which directly enables the endpoint to return voice call extension information. The end-to-end tests are also updated to verify this new capability with a dedicated test case that creates a user with a freeSwitchExtension and confirms the filtering works correctly.
✨ 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 feat/extensionAutocomplete

📜 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 1acf6a3 and c4ac575.

📒 Files selected for processing (4)
  • .changeset/wicked-chairs-compete.md (1 hunks)
  • apps/meteor/app/api/server/lib/users.ts (1 hunks)
  • apps/meteor/tests/data/users.helper.ts (1 hunks)
  • apps/meteor/tests/end-to-end/api/users.ts (4 hunks)
🧰 Additional context used
🧠 Learnings (14)
📚 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 descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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/data/users.helper.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 : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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 : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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 : Ensure a clean state for each test execution

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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 : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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/**/*.{ts,tsx,js,jsx} : Write concise, technical TypeScript/JavaScript with accurate typing

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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 test.beforeAll() and test.afterAll() for setup and teardown

Applied to files:

  • apps/meteor/tests/data/users.helper.ts
  • apps/meteor/tests/end-to-end/api/users.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 : Prefer web-first assertions (e.g., toBeVisible, toHaveText)

Applied to files:

  • apps/meteor/tests/data/users.helper.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/**/*.{ts,tsx,js,jsx} : Follow DRY by extracting reusable logic into helper functions or page objects

Applied to files:

  • apps/meteor/tests/end-to-end/api/users.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 test.step() to organize complex test scenarios

Applied to files:

  • apps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
PR: RocketChat/Rocket.Chat#37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
PR: RocketChat/Rocket.Chat#37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/tests/end-to-end/api/users.ts
🧬 Code graph analysis (1)
apps/meteor/tests/end-to-end/api/users.ts (3)
apps/meteor/tests/data/users.helper.ts (3)
  • createUser (10-39)
  • login (41-55)
  • deleteUser (57-64)
apps/meteor/tests/data/api-data.ts (2)
  • credentials (39-42)
  • request (10-10)
apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
  • deleteRoom (48-50)

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.

@gabriellsh gabriellsh added this to the 7.13.0 milestone Oct 27, 2025
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.54%. Comparing base (65fbcbe) to head (6fa5102).
⚠️ Report is 18 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37313      +/-   ##
===========================================
- Coverage    67.92%   67.54%   -0.39%     
===========================================
  Files         3356     3278      -78     
  Lines       114894   113648    -1246     
  Branches     20754    20441     -313     
===========================================
- Hits         78040    76758    -1282     
- Misses       34171    34263      +92     
+ Partials      2683     2627      -56     
Flag Coverage Δ
e2e 55.89% <ø> (-1.56%) ⬇️
unit 71.98% <ø> (-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.

@gabriellsh gabriellsh marked this pull request as ready for review October 30, 2025 19:47
@gabriellsh gabriellsh requested a review from a team as a code owner October 30, 2025 19:47
@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Oct 30, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 30, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Oct 30, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants