-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Describe the bug
App crashes consistently when launched from terminated state via VoIP push notification. The crash occurs during CallAgent creation with error 500 ("Åtgärden kunde inte slutföras. (com.arenaaccess.arena fel 500.)" - "The operation could not be completed. (com.arenaaccess.arena error 500.)"). This results in 100% call failure rate when the app is completely killed and relaunched via push notification.
Exception or Stack Trace
`Incident Identifier: [redacted]
CrashReporter Key: 0000000000000000000000000000000000000000
Hardware Model: iPhone14,5
Process: arena
OS Version: iOS 18.5
Exception Type: com.arenaaccess.arena
Exception Subtype: Åtgärden kunde inte slutföras. (com.arenaaccess.arena fel 500.)
Thread undefined:
0 arena 0x0000000102338f90 0x1022dc000 + 380816
1 arena 0x00000001023328dc 0x1022dc000 + 354524
2 arena 0x0000000102351da0 0x1022dc000 + 482720
3 arena 0x0000000102355398 0x1022dc000 + 496536
4 AzureCommunicationCalling 0x000000010278d200 0x102774000 + 102912
5 AzureCommunicationCalling 0x000000010278d79c 0x102774000 + 104348
6 libdispatch.dylib 0x0000000197ff0aac dispatchcall_block_and_release
7 libdispatch.dylib 0x000000019800a584 dispatchclient_callout
8 libdispatch.dylib 0x00000001980275a0 dispatchmain_queue_drain.cold.5
9 libdispatch.dylib 0x0000000197fffd30 dispatchmain_queue_drain
10 libdispatch.dylib 0x0000000197fffc6c dispatchmain_queue_callback_4CF
11 CoreFoundation 0x00000001900d1d90 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
12 CoreFoundation 0x00000001900754f4 __CFRunLoopRun
13 CoreFoundation 0x0000000190076c3c CFRunLoopRunSpecific
14 GraphicsServices 0x00000001dd255454 GSEventRunModal
15 UIKitCore 0x0000000192a89274 -[UIApplication run]
16 UIKitCore 0x0000000192a54a28 UIApplicationMain
17 SwiftUI 0x0000000194b997a4 closure #1 in KitRendererCommon(:)
18 SwiftUI 0x000000019489f01c runApp(_:)
19 SwiftUI 0x000000019489eed0 static App.main()
20 arena 0x00000001022eb00c 0x1022dc000 + 61452
Context: "Failed to create CallAgent in pushRegistry"
Exception Cause: "Åtgärden kunde inte slutföras. (com.arenaaccess.arena fel 500.)"
Users affected: 1
Occurrences: 4`
To Reproduce
- Force quit the app completely (swipe up and close from app switcher)
- Send a VoIP push notification for an incoming call
- App launches via push notification
- AppDelegate receives push in
pushRegistry(_:didReceiveIncomingPushWith:for:completion:) CallClient.reportIncomingCall()is called successfully- CallManager attempts to create CallAgent during push handling
- CRASH OCCURS with error 500 during CallAgent creation in AzureCommunicationCalling framework
Code Snippet
// Current AppDelegate implementation that crashes
extension AppDelegate: PKPushRegistryDelegate {
func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
guard type == .voIP else { return }
let deviceToken = pushCredentials.token
appPubs.pushToken = registry.pushToken(for: .voIP) ?? nil
CallManager.shared.setPendingPushToken(deviceToken)
if let token = userDefaults.string(forKey: CallCredentialsKeys.intercomAccessToken),
!token.isEmpty {
if CallManager.shared.callAgent == nil {
// THIS IS WHERE THE CRASH HAPPENS - during CallAgent creation from terminated state
CallManager.shared.createCallAgentWithToken(token: token) { error in
if let error = error {
NewRelicService.logError(error, attributes: ["context" : "Failed to create CallAgent in pushRegistry"])
}
}
} else {
CallManager.shared.registerPushNotifications()
}
}
}
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType,
completion: @escaping () -> Void) {
if payload.dictionaryPayload.isEmpty {
completion()
return
}
// This part works - successfully reports to CallKit
let callNotification = PushNotificationInfo.fromDictionary(payload.dictionaryPayload)
let callKitOptions = CallKitOptions(with: CallKitObjectManager.createCXProvideConfiguration())
CallKitObjectManager.setPendingCall(notification: callNotification)
CallClient.reportIncomingCall(with: callNotification, callKitOptions: callKitOptions) { error in
if let error = error {
NewRelicService.logError(error, attributes: ["context": "Failed to report incoming call to CallKit"])
// ... error handling
}
completion()
}
}
}
// CallManager creation method that crashes with error 500
func createCallAgentWithToken(token: String, completionHandler: ((Error?) -> Void)?) {
guard !token.isEmpty else {
completionHandler?(CallManagerError.noToken)
return
}
do {
let userCredential = try CommunicationTokenCredential(token: token)
let options = createCallAgentOptions()
// CRASH OCCURS HERE - callClient.createCallAgent fails with error 500
callClient.createCallAgent(userCredential: userCredential, options: options) { [weak self] (agent, error) in
if let error = error {
NewRelicService.logError(error, attributes: [
"context": "createCallAgentWithToken - CallAgentCreationError",
"errorDescription": error.localizedDescription
])
// Error 500 logged here before crash
completionHandler?(error)
} else {
// Success path - never reached in terminated state
self?.callAgent = agent
self?.incomingCallHandler = IncomingCallHandler()
self?.callAgent?.delegate = self?.incomingCallHandler
self?.registerPushNotifications()
completionHandler?(nil)
}
}
} catch {
completionHandler?(error)
}
}
private func createCallAgentOptions() -> CallAgentOptions {
let options = CallAgentOptions()
let callKitOptions = CallKitOptions(with: CallKitObjectManager.createCXProvideConfiguration())
options.callKitOptions = callKitOptions
return options
}Expected behavior
- CallAgent should be created successfully when app launches from terminated state via VoIP push notification
- No crashes should occur during CallAgent creation
- Push notifications should reliably establish incoming calls regardless of app state
- Error 500 responses from the service should be handled gracefully without crashing the app
Setup (please complete the following information):
- OS: iOS 18.5
- IDE : Xcode 16.3
- Version of the Library used: 2.15.1
But all devices on varying iOS versions has been affected.
Additional context
- Critical Issue: This crash occurs 100% of the time when the app is launched from terminated state via VoIP push
- Error Pattern: Always fails with HTTP 500-style error during CallAgent creation
- Timing: Crash happens specifically during
CallClient.createCallAgent()call in the AzureCommunicationCalling framework - Call Flow:
CallClient.reportIncomingCall()succeeds, but subsequent CallAgent creation fails - Service Error: The error 500 suggests a server-side issue rather than client-side validation failure
- Impact: Users cannot receive calls when the app is not running, making the calling feature unreliable
Specific Azure Communication Services Context:
- Using
CallClient.createCallAgent()withCommunicationTokenCredential - CallKit integration via
CallKitOptionswithCallKitObjectManager.createCXProvideConfiguration() - Push notification flow: VoIP push →
CallClient.reportIncomingCall()→ CallAgent creation crashes - Error occurs in AzureCommunicationCalling framework, not in application code
- Token appears to be valid (no 401 errors, direct 500 response)
Root Cause Analysis Needed:
- Why does CallAgent creation fail with error 500 specifically from terminated state?
- Is there a service initialization issue when the app cold-starts from push notifications?
- Are there timing constraints or service dependencies not met during terminated state launches?
- Should there be additional error handling or retry logic for service errors?
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- Bug Description Added
- Repro Steps Added
- Setup information Added