-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(voip): ship blockers for PushKit, licensing, outbound calls, push tokens #7167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
diegolmello
wants to merge
1
commit into
feat.voip-lib-new
Choose a base branch
from
cursor/b082663a
base: feat.voip-lib-new
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+81
−24
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { clearEnterpriseModules, setEnterpriseModules } from '../../actions/enterpriseModules'; | ||
| import { initStore } from '../store/auxStore'; | ||
| import { mockedStore } from '../../reducers/mockedStore'; | ||
| import { isVoipModuleAvailable } from './enterpriseModules'; | ||
|
|
||
| describe('isVoipModuleAvailable', () => { | ||
| beforeAll(() => { | ||
| initStore(mockedStore); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| mockedStore.dispatch(clearEnterpriseModules()); | ||
| }); | ||
|
|
||
| it('returns false when teams-voip is absent', () => { | ||
| mockedStore.dispatch(setEnterpriseModules(['omnichannel-mobile-enterprise'])); | ||
| expect(isVoipModuleAvailable()).toBe(false); | ||
| }); | ||
|
|
||
| it('returns true when teams-voip is present', () => { | ||
| mockedStore.dispatch(setEnterpriseModules(['teams-voip'])); | ||
| expect(isVoipModuleAvailable()).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
On iOS 13+ PushKit didReceiveIncomingPushWith, must completion() be invoked only after CallKit reportNewIncomingCall's completion handler fires?💡 Result:
Yes. For iOS 13.0+ VoIP PushKit callbacks, you should invoke the PushKit completion only after you have finished reporting the call to CallKit—i.e., inside the completion block of CXProvider.reportNewIncomingCall(with:update:completion:) (after it fires), not before. Apple’s PushKit delegate documentation explicitly notes that when calling CallKit from pushRegistry(_:didReceiveIncomingPushWith:for:completion:), “If you fail to report a call to CallKit, the system will terminate your app,” and the PushKit “Responding to VoIP Notifications” example calls PushKit completion from inside the CallKit reportNewIncomingCall completion block. This implies the required ordering: report to CallKit first, then tell PushKit you’re done after that report completes.
Citations:
🏁 Script executed:
Repository: RocketChat/Rocket.Chat.ReactNative
Length of output: 117
🏁 Script executed:
cat -n ios/Libraries/AppDelegate+Voip.swift | head -100Repository: RocketChat/Rocket.Chat.ReactNative
Length of output: 4107
Happy-path calls
completion()before CallKit reporting completes — violates Apple's PushKit requirement.The error path correctly defers
completion()into theonReportCompletecallback (line 59), but the happy path passes an emptyonReportComplete: {}and then callscompletion()synchronously at line 91. Per Apple's PushKit documentation (iOS 13+),completion()must be invoked only after CallKit'sreportNewIncomingCallcallback fires. Calling it before can cause the system to terminate the app for not fulfilling the PushKit entitlement contract.Route
completion()through the helper'sonReportCompleteparameter to match the error path:Proposed fix
reportVoipIncomingCallToCallKit( callUUID: callId, handle: caller, localizedCallerName: caller, payload: payloadDict, - onReportComplete: {} + onReportComplete: { completion() } ) - completion()📝 Committable suggestion
🤖 Prompt for AI Agents