Repository navigation
Fix missing GRDB background suspension handling - #241
Merged
Merged
Conversation
Contributor
[High impact] The PR appears safe to merge; the background call-history gap is addressed. SummaryThe PR connects UIKit lifecycle events to GRDB suspension and protects authorized background database work.
The previous call-history finding is addressed. No new actionable issues were found. Tests were not run during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App lifecycle or background grant changes] --> B{Foreground or live grant?}
B -->|Yes| C[Resume app GRDB pools]
B -->|No| D[Suspend app GRDB pools]
E[Call-history write] --> F[Acquire bounded UIKit task and access token]
F --> G[Wait for earlier writes]
G --> H{Grant still active?}
H -->|Yes| I[Write call history]
H -->|No| J[Skip expired write]
I --> K[Release token before ending UIKit task]
L[Task expires] --> K
K --> A
Reviews (2) · Last reviewed commit: "fix: protect background call-history wri..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TestFlight's October 24 crash on 0.2.5 (146) records
RUNNINGBOARD 0xdead10ccwhile thread 3 is executingMessageRepository.applyAnnouncedDisplayNameinside a GRDB write transaction. The earlier node-lease fix (#230) is already in that release.The app's GRDB pools set
observesSuspensionNotifications = true, but the application never posted GRDB's explicit suspend/resume notifications. That flag does not observe UIKit lifecycle automatically. This is a confirmed protection gap; the captured stack does not establish conclusively which lock caused the production kill.Changes
Verification
c99ae584) with only the test added. UIKit background notification did not stop the announced-name write; the lifecycle test failed with 3 assertions. Direct GRDB suspension already passed, isolating the missing bridge.68124), and visually confirmed the Chats screen. Simulator had no configured network interfaces.The smoke validates lifecycle/reopen behavior, not production crash elimination under announce traffic. Physical-device
0xdead10ccprevention and NE background message delivery have not been reverified in this change.Greptile correction (38869e6)
PASS persistedEnd=true failedOutcome=true accessRevoked=true. This exercises actual CallManager/repository writes while app database access is suspended; it is not a real remote audio-call test.