Skip to content

Add SyncEngine.pendingChangeCounts#500

Open
gigq wants to merge 1 commit into
pointfreeco:mainfrom
gigq:pending-change-counts
Open

Add SyncEngine.pendingChangeCounts#500
gigq wants to merge 1 commit into
pointfreeco:mainfrom
gigq:pending-change-counts

Conversation

@gigq

@gigq gigq commented Jul 16, 2026

Copy link
Copy Markdown

This makes the pending save, delete, and database change counts available for things like debug and diagnostics views. It returns nil when the sync engine isn’t running and updates when CKSyncEngine reports a state change.

Tested this in my app, count changes come in live as expected.

This makes the pending save, delete, and database change counts available for things like debug and diagnostics views. It returns nil when the sync engine isn’t running and updates when CKSyncEngine reports a state change.
///
/// This value is `nil` when the sync engine is not running. It is observable, and so accessing
/// it from a SwiftUI view will cause the view to update as the pending changes change.
public var pendingChangeCounts: PendingChangeCounts? {

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.

Does this really need to be optional? You already know if the engine is running or not via the public isRunning property, and so shouldn't this property always reflect the pending changes, regardless of running or not?

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