Skip to content

feat(apps): add method to find user by freeswitch extension to apps user bridge#40604

Merged
ggazzo merged 6 commits into
developfrom
feat/apps-freeswitch-extension
May 20, 2026
Merged

feat(apps): add method to find user by freeswitch extension to apps user bridge#40604
ggazzo merged 6 commits into
developfrom
feat/apps-freeswitch-extension

Conversation

@d-gubert
Copy link
Copy Markdown
Member

@d-gubert d-gubert commented May 18, 2026

Proposed changes (including videos or screenshots)

Issue(s)

DMV-12

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • Apps can lookup and retrieve users by SIP extension for FreeSWITCH telephony integration.
    • User profiles optionally include a SIP extension field for improved identification.
    • User data now maps SIP extension fields consistently between the platform and apps.
  • Chores
    • Release metadata updated to reflect a minor version bump.

Review Change Stack

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 18, 2026

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 6dc4b39

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

This PR includes changesets to release 43 packages
Name Type
@rocket.chat/apps-engine Minor
@rocket.chat/meteor Minor
@rocket.chat/apps Patch
@rocket.chat/core-typings Minor
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/rest-typings Minor
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/core-services Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-voip Major
@rocket.chat/api-client Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/models 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/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac 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/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-composer Major

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
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c85ca30-bd58-46b8-8cd8-6069ce2ecafb

📥 Commits

Reviewing files that changed from the base of the PR and between 45c7682 and 6dc4b39.

📒 Files selected for processing (1)
  • apps/meteor/app/apps/server/converters/users.js
📜 Recent review details
⏰ 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). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (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/app/apps/server/converters/users.js
🔇 Additional comments (1)
apps/meteor/app/apps/server/converters/users.js (1)

48-48: LGTM!

Also applies to: 78-78


Walkthrough

This PR enables apps to fetch users by FreeSWITCH SIP extension by adding an optional sipExtension to IUser, a getBySipExtension accessor, bridge methods with permission checks, converter mappings for SIP fields, and a Meteor bridge implementation that looks up users by FreeSWITCH extension.

Changes

SIP Extension User Lookup Capability

Layer / File(s) Summary
User type definitions and interface contracts
packages/apps-engine/src/definition/users/IUser.ts, packages/apps-engine/src/definition/accessors/IUserRead.ts
IUser adds optional sipExtension field. IUserRead declares new getBySipExtension(extension) method returning a promise of optional user.
Bridge abstraction and permission-checked entry point
packages/apps/src/server/bridges/UserBridge.ts
UserBridge adds public doGetBySipExtension method guarded by read-permission check and protected abstract getBySipExtension method for subclass implementations.
UserRead accessor implementation
packages/apps/src/server/accessors/UserRead.ts
UserRead.getBySipExtension delegates to the bridge's doGetBySipExtension, passing the app context and short-circuiting on falsy input.
User data converters
apps/meteor/app/apps/server/converters/users.js
AppUsersConverter maps sipExtension from user.freeSwitchExtension in both convertToApp and convertToRocketChat directions.
Meteor server bridge implementation
apps/meteor/app/apps/server/bridges/users.ts
AppUserBridge implements getBySipExtension by looking up users via Users.findOneByFreeSwitchExtension and converting to app-scoped user. Also refactors getAppUser to remove redundant options parameter.
Release documentation
.changeset/public-ravens-like.md
Changeset declares minor version bumps for @rocket.chat/apps-engine and @rocket.chat/meteor with description of new SIP extension user lookup capability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: feature

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a method to find users by FreeSWITCH extension to the apps user bridge, which is the primary focus across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • DMV-12: Request failed with status code 401

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.

@d-gubert d-gubert changed the title feat: add a method to find a user by freeswitch extension to apps user bridge feat(apps): add method to find user by freeswitch extension to apps user bridge May 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.68%. Comparing base (a44b12e) to head (6dc4b39).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40604      +/-   ##
===========================================
+ Coverage    69.63%   69.68%   +0.05%     
===========================================
  Files         3323     3323              
  Lines       122762   122805      +43     
  Branches     21898    21914      +16     
===========================================
+ Hits         85481    85580      +99     
+ Misses       33915    33873      -42     
+ Partials      3366     3352      -14     
Flag Coverage Δ
e2e 59.32% <ø> (+0.12%) ⬆️
e2e-api 46.19% <ø> (-0.86%) ⬇️
unit 70.37% <ø> (+0.06%) ⬆️

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.

@d-gubert d-gubert force-pushed the feat/apps-freeswitch-extension branch from da07f69 to 557e387 Compare May 19, 2026 17:46
@d-gubert
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@d-gubert d-gubert added this to the 8.5.0 milestone May 19, 2026
@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label May 19, 2026
Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/app/apps/server/converters/users.js`:
- Line 78: convertToRocketChat currently assigns sipExtension:
user.freeSwitchExtension which reverses the mapping and drops the actual
app-exposed field; change the mapping in convertToRocketChat to set
freeSwitchExtension: user.sipExtension (i.e., read user.sipExtension and write
it into the Rocket.Chat field freeSwitchExtension) so the app's sipExtension
prop is persisted to Rocket.Chat correctly; verify the opposite direction
(convertFromRocketChat) still maps freeSwitchExtension → sipExtension
consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 331bbe39-9004-477f-9453-04189c468e41

📥 Commits

Reviewing files that changed from the base of the PR and between 78814a8 and 45c7682.

📒 Files selected for processing (7)
  • .changeset/public-ravens-like.md
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/converters/users.js
  • packages/apps-engine/src/definition/accessors/IUserRead.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps/src/server/accessors/UserRead.ts
  • packages/apps/src/server/bridges/UserBridge.ts
📜 Review details
⏰ 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). (5)
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 📦 Meteor Build (coverage)
🧰 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:

  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps-engine/src/definition/accessors/IUserRead.ts
  • packages/apps/src/server/accessors/UserRead.ts
  • apps/meteor/app/apps/server/converters/users.js
  • apps/meteor/app/apps/server/bridges/users.ts
🧠 Learnings (6)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps-engine/src/definition/accessors/IUserRead.ts
  • packages/apps/src/server/accessors/UserRead.ts
  • apps/meteor/app/apps/server/bridges/users.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps-engine/src/definition/accessors/IUserRead.ts
  • packages/apps/src/server/accessors/UserRead.ts
  • apps/meteor/app/apps/server/bridges/users.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps-engine/src/definition/accessors/IUserRead.ts
  • packages/apps/src/server/accessors/UserRead.ts
  • apps/meteor/app/apps/server/bridges/users.ts
📚 Learning: 2026-05-11T21:46:23.471Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40463
File: packages/apps/src/lib/SecureFields.ts:17-19
Timestamp: 2026-05-11T21:46:23.471Z
Learning: In Rocket.Chat’s `packages/apps/tsconfig.json`, TypeScript `"strict"` is set to `false`, which disables strict type-checking (including `noImplicitAny`) for `packages/apps`. When reviewing, do not flag TS7053 (and similar strict-mode indexing/type errors) in files under `packages/apps/src/` that are a consequence of this relaxed strictness—e.g., patterns like indexing an `unknown`/`object` via optional chaining such as `object?.[kSecureFields]`.

Applied to files:

  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps/src/server/accessors/UserRead.ts
📚 Learning: 2026-05-06T20:47:53.078Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: apps/meteor/app/apps/server/bridges/uiInteraction.ts:2-2
Timestamp: 2026-05-06T20:47:53.078Z
Learning: Deep imports must be used in this repository because Meteor’s bundler does not respect package.json exports subpath mappings. Import using deep paths (e.g., rocket.chat/apps/dist/server/bridges/UiInteractionBridge) instead of relying on exports. Do not suggest or apply changes to exports maps in Meteor-consuming packages (e.g., packages/apps/package.json) as a fix for deep imports. This guideline applies to all TypeScript files under apps/meteor/app/apps/server/bridges.

Applied to files:

  • apps/meteor/app/apps/server/bridges/users.ts
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/public-ravens-like.md
🔇 Additional comments (7)
.changeset/public-ravens-like.md (1)

1-7: LGTM!

packages/apps-engine/src/definition/users/IUser.ts (1)

24-24: LGTM!

packages/apps-engine/src/definition/accessors/IUserRead.ts (1)

12-13: LGTM!

packages/apps/src/server/bridges/UserBridge.ts (1)

21-25: LGTM!

Also applies to: 77-78

packages/apps/src/server/accessors/UserRead.ts (1)

20-27: LGTM!

apps/meteor/app/apps/server/converters/users.js (1)

48-48: LGTM!

apps/meteor/app/apps/server/bridges/users.ts (1)

44-47: LGTM!

Also applies to: 49-50

Comment thread apps/meteor/app/apps/server/converters/users.js Outdated
d-gubert and others added 2 commits May 19, 2026 17:43
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@d-gubert d-gubert marked this pull request as ready for review May 19, 2026 20:44
@d-gubert d-gubert requested a review from a team as a code owner May 19, 2026 20:44
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

Re-trigger cubic

@d-gubert d-gubert added the stat: QA assured Means it has been tested and approved by a company insider label May 19, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label May 19, 2026
Copy link
Copy Markdown
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

do we want to call it "sip" for apps but internally call it "freeswitch"? I wonder if this can bring confusion and even create conflicts in the future like if we decide to have a "sip" field on rocket.chat

@d-gubert
Copy link
Copy Markdown
Member Author

do we want to call it "sip" for apps but internally call it "freeswitch"? I wonder if this can bring confusion and even create conflicts in the future like if we decide to have a "sip" field on rocket.chat

@sampaiodiego This was a suggestion from @pierre-lehnen-rc , he pointed out the plan is exactly to rename the field to sipExtension in the next major

@ggazzo ggazzo merged commit 2198d9e into develop May 20, 2026
82 of 84 checks passed
@ggazzo ggazzo deleted the feat/apps-freeswitch-extension branch May 20, 2026 14:43
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 type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants