This diff moves call to completionHandler from rescinding callback in AppDelegate in handleBackgroundNotification. As established before rescinding callback is highly unlikely to ever be called, but failure to call completionHandler will result in app being terminated by the system
Details
Launch the app from XCode and put it into background mode. Open two web clients one of which is the same as mobile one. Send messages and read them on web client several times waiting a couple of minutes between each trial. Ensure that app is still running.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
This code doesn't work correctly. We need to wait for the loop to finish before calling the completion handler. The code starting with ^ is a block and can return before being completed (just like an async function).
So the idea on this diff is that we want to make sure that we call completionHandler before we return YES, as well as calling completionHandler on the main thread? Whereas the idea of D4576 is that we just need to call completionHandler on the main thread, and the order of return YES vs. calling completionHandler does not matter?
Thanks for fixing things up!! Removing from my queue until we can confirm it's necessary (we're first testing just D4576 on its own)
This diff was only used to create a release that was supposed to fix a crash: https://linear.app/comm/issue/ENG-1464/ios-build-137-crashes. The solution wasn't correct.