fix: hide voice-call icon for users without a phone extension#40862
fix: hide voice-call icon for users without a phone extension#40862ggazzo wants to merge 3 commits into
Conversation
In a DM the voice-call icon was shown for any user, even one without a phone extension. Clicking it opened the call widget for an instant and then hid it, since the call could not be placed. When internal calls are routed through SIP (`VoIP_TeamCollab_SIP_Integration_For_Internal_Calls`), the callee can only be reached if they have a `freeSwitchExtension` assigned, so gate the room action on it. With SIP routing disabled, internal calls are peer-to-peer and need no extension, so the action keeps showing. Covered by unit tests on `useMediaCallRoomAction`.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 07d92c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40862 +/- ##
=========================================
Coverage 70.12% 70.12%
=========================================
Files 3341 3341
Lines 123558 123671 +113
Branches 22136 22142 +6
=========================================
+ Hits 86642 86723 +81
- Misses 33567 33597 +30
- Partials 3349 3351 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
The avatar mock returned a string, which only worked because the prior tests never resolved the user-info query and so never invoked getAvatarUrl. The DMV-62 cases await the query, so the peer info is built and getAvatarUrl is called — make the mock a hook returning a getter function.
Proposed changes
In a direct message the voice-call icon was shown for any user, even one without a phone extension. Clicking it opened the call widget for an instant and then hid it, since the call could not be placed (DMV-62).
When internal calls are routed through SIP (
VoIP_TeamCollab_SIP_Integration_For_Internal_Calls), the callee can only be reached if they have afreeSwitchExtensionassigned, souseMediaCallRoomActionnow gates the action on it. With SIP routing disabled, internal calls are peer-to-peer and need no extension, so the action keeps showing as before.Visibility rule:
permission AND ( (SIP routing enabled AND peer has extension) OR SIP routing disabled )Issue(s)
DMV-62
How to test the changes
VoIP_TeamCollab_SIP_Integration_For_Internal_Calls.Further comments
useMediaCallRoomAction.spec.tsx(SIP-routing × extension matrix).freeSwitchExtensionis already returned byusers.info(DefaultUserInfo), reused from the existinguseUserInfoQuery.DMV-62