mirror of
https://github.com/ProtonMail/ios-mail.git
synced 2026-06-14 09:54:45 +00:00
When the app is updated while in the background, the system cold-launches your process and immediately fires your background task. Because your initialization (mail user session setup) isn't yet complete, the background task's work ends too soon and the system thinks you've finished all background activity. That violates the expectation that no further background work should occur once the task reports completion. Scenario 1. App is installed and user is logged in. 2. User goes background. 3. App is updated. 4. System cold-runs the updated app to execute scheduled background tasks. 5. Background task starts together with session initialization. Background task finsihes first and we let the system know that all background execution is completed - which is not true and usually cause crash, in our case `0xdead10cc` - deadlock. The reason is we didn't have enough of time to release file locks.