iOS app/OS behavior with heavy background processing and differences between Xcode/Testflight/App Store

I'm analyzing an app which is doing some processing with contacts, and stress testing it with tens and tens of thousands of contacts which are being processed.

The code is being processed within DispatchQueue.global(qos: .background).async {)

When the app moves to the foreground the processing starts and continues after the app moves to the background. What I've noticed is that if the app is downloaded from TestFlight, then ~20 seconds after moving to the background, a dialog is displayed saying the App Crashed. Though it hasn't actually "crashed" in the usual sense of crash - there's no crash log present on the device nor in TestFlight if the crash is reported nor is there anything reported to Crashlytics. In addition the is still displayed in the iPhone task manager, also ApplicationWillTerminate() isn't called so it wasn't killed by the OS.

This doesn't happen if the app is installed via Xcode and then run (not run via Xcode, installed via Xcode, then run independently from Xcode).

When running via TestFlight installation I can see the OS logging"

ReportCrash recordCrashEvent; isBeta 1 app stored Received a beta app crash notification.

What's going on here, why is TestFlight reporting this? Is it erroneously reporting the background processing after 20 seconds as a crash? Is there anything the app should be doing in this situation that it isn't? Otherwise why is TF popping up that dialog?

iOS app/OS behavior with heavy background processing and differences between Xcode/Testflight/App Store
 
 
Q