Skip to content

Propagate suspension handling to CloudKit metadata - #502

Merged
mbrandonw merged 3 commits into
pointfreeco:mainfrom
phil1995:feature/propagate-metadatabase-suspension
Jul 27, 2026
Merged

Propagate suspension handling to CloudKit metadata#502
mbrandonw merged 3 commits into
pointfreeco:mainfrom
phil1995:feature/propagate-metadatabase-suspension

Conversation

@phil1995

Copy link
Copy Markdown
Contributor

Motivation

SyncEngine already includes iOS-specific lifecycle handling: it observes UIApplication.willResignActiveNotification, begins a background task, and attempts to send pending private and shared CloudKit changes before the app is suspended.

watchOS does not use this integration and can suspend apps much more aggressively. GRDB supports this environment through the experimental flag observesSuspensionNotifications, allowing clients to release database locks when posting Database.suspendNotification.

However, while the user database can opt into this behavior, SyncEngine maintains a separate CloudKit metadata connection that does not currently participate. This can leave the metadata database holding a SQLite lock during suspension, resulting in a RUNNINGBOARD 0xdead10cc termination on watchOS.

@mbrandonw mbrandonw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @phil1995! I made a few small updates, but overall looks good!

@mbrandonw
mbrandonw merged commit 5141f7f into pointfreeco:main Jul 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants