Notes edit offline and reconcile when connectivity returns. The engine must be an
actor, expose an AsyncStream of sync events,
and never block the main actor.
Note with SwiftData @ModelSyncEngine actor with backpressure-safe queue// SyncEngine.swift actor SyncEngine { private let store: ModelContext private var pending: [Change] = [] let events: AsyncStream<SyncEvent> private let continuation: AsyncStream<SyncEvent>.Continuation init(store: ModelContext) { self.store = store (events, continuation) = AsyncStream.makeStream() } func enqueue(_ change: Change) { pending.append(change) continuation.yield(.queued(change.id)) } }