Skip to content

Commit 97a9f83

Browse files
zmanianclaude
andcommitted
Add main queue precondition to handleBackgroundRefresh
Fails fast with a clear message if this is ever called off the main queue, rather than hitting an opaque Swift concurrency isolation crash. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 43d8b33 commit 97a9f83

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Wisp/Services/LoopManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ final class LoopManager {
134134
}
135135

136136
func handleBackgroundRefresh(modelContext: ModelContext) async -> Bool {
137+
dispatchPrecondition(condition: .onQueue(.main))
137138
defer {
138139
scheduleBackgroundRefresh(modelContext: modelContext)
139140
}

0 commit comments

Comments
 (0)