mattermost-mobile-upstream/ios/Mattermost
Elias Nahum 7d0e1de2a7
Guard long-running DB chains against RUNNINGBOARD 0xdead10cc on iOS (#10110) (#10133) (#10136)
* Guard long-running DB chains against RUNNINGBOARD 0xdead10cc on iOS

iOS can terminate the app if it's suspended while a SQLite statement
still holds the shared App Group database lock. AppDelegate already
held a single background-task assertion across the background
transition, but it was a blind, fixed-duration timer: it never
tracked whether a DB operation was actually still running, and a
chain that started after the timer had already begun (or ran long
enough to outlast it) got no protection.

Add DatabaseActivityAssertion (a Swift port of Quinn "The Eskimo!"'s
QRunInBackgroundAssertion) and DatabaseLockProtectionManager, which
lets any caller - the app lifecycle transition, or a specific
long-running chain - acquire its own independent background-task
job and release it exactly when its own work finishes. Wire this
into the websocket reconnect sync (doReconnect) and the deferred
per-team entry sync (restDeferredAppEntryActions), the two longest
sequential local-DB chains in the app, via a new pair of RNUtils
methods (iOS only; Android is a no-op, since 0xdead10cc has no
Android equivalent).

* fix tests

(cherry picked from commit bc84b6ee3a)

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-09-07 08:57:04 +03:00
..
Extensions Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
Helpers MM-66173 fixes crash when receiving notifications (#9243) 2025-11-01 19:19:31 +08:00
i18n Added localization into iOS share extension (#7351) 2023-06-21 12:42:31 +02:00
Images.xcassets updated splash screen assets (#9483) 2026-02-03 11:19:59 -05:00
Utils Upgrade RN as well as update or replace other dependencies (#8011) 2024-06-19 09:33:45 +08:00
AppDelegate.swift Guard long-running DB chains against RUNNINGBOARD 0xdead10cc on iOS (#10110) (#10133) (#10136) 2026-09-07 08:57:04 +03:00
Info.plist Bump app build number to 806 (#10088) 2026-08-21 08:36:20 +03:00
Mattermost-Bridging-Header.h Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
Mattermost.entitlements Notifications profile images (#6904) 2022-12-24 00:21:08 +02:00