XPC communication with the extension was interrupted - Shortcuts Automation

Hello,


This is the notification some of my app users are encountering on iOS 13. The app has an extension that works with Apple Shortcuts.


It returns an integer, and it is meant to be used with the new Shortcuts Automation feature. Here is the code :


func handle(intent: CarrierIntent, completion: @escaping (CarrierIntentResponse) -> Void) {

        RoamingManager.engine(g3engine: true) { result in
            
            var performOperations = false
            
            if result == "HPLUS" || result == "WCDMA" || result == "EDGE" {
                performOperations = true
            } else if result == "POSSHPLUS" {
                NotificationManager.sendNotification(for: .alertPossibleHPlus)
            } else if result == "POSSWCDMA" {
                NotificationManager.sendNotification(for: .alertPossibleWCDMA)
            }
            
            completion(CarrierIntentResponse.success(carrier: performOperations ? 1 : 0))
        }
        }

What have I done wrongly? Thanks.