Skip to content

[Drift] ObservableSyncStatus utility added to Swift SDK (powersync-swift #154) #527

Description

@benitav

What's changing: The Swift SDK fixes SyncStatus.asFlow() to emit fresh snapshot instances on each status change (previously the same mutable object was re-emitted, so SwiftUI views could silently miss updates), and introduces ObservableSyncStatus — accessible via db.currentStatus.observable — as a new @Observable-based class for tracking sync status. The API is gated on macOS 14.0 / iOS 17.0 / watchOS 10.0 / tvOS 17.0 or later.

High priority — existing docs are now inaccurate or incomplete
None identified. This PR does not clear the hard precondition; see reviewer consideration below.

For reviewer consideration — may be worth documenting
The Swift SDK docs likely cover observing currentStatus changes in SwiftUI. ObservableSyncStatus (accessed via db.currentStatus.observable) is now the recommended approach for SwiftUI on iOS 17+/macOS 14+, replacing the asFlow() + @State private var loop shown in the demo app before this PR. The old pattern was also subtly broken (the same mutable reference was dispatched, so @State might not trigger re-renders), which this PR corrects — any existing documented example using that pattern now works as expected rather than silently dropping updates. Candidate page: Swift SDK integration guide or sync status reference; not verified from available sources.

Source PR: powersync-ja/powersync-swift#154 — merged 2026-06-30.

Filed automatically by Claude Code (claude-sonnet-4-6). A human must verify the scope, prepare the docs PR, and publish it only once this update has been released.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions