Queue document writes durably and surface sync trouble in the UI
iCloud Drive writes now flow through a persistent WriteBacklog sidecar (drained with backoff, flushed on backgrounding, wiped with the cache on account change), so a save can never be lost to a transient coordinator error. A status banner on the workout list surfaces stuck syncing. Also: the split picker gains a Recent section with day labels, split rows fold SplitItem into SplitListView, and list rows dim the multiply sign in sets-by-reps. Claude-Session: https://claude.ai/code/session_01HJDQQDA9QdP8zByg43H5v3
This commit is contained in:
@@ -31,6 +31,11 @@ struct WorkoutsApp: App {
|
||||
// the app is backgrounded, so re-assert it each time the scene becomes active.
|
||||
.onChange(of: scenePhase, initial: true) { _, phase in
|
||||
UIApplication.shared.isIdleTimerDisabled = (phase == .active)
|
||||
// Last chance before suspension: push any queued document writes out
|
||||
// now rather than waiting out a retry backoff we may not live to see.
|
||||
if phase == .background {
|
||||
Task { await services.syncEngine.flushPendingWrites() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user