Draft
Conversation
Use #sql macro-based execution/fetch paths in undo setup, replay, and trigger helpers for safer SQL handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Echo-backs from handleSentRecordZoneChanges now suppress undo recording entirely via a new SyncChangeKind TaskLocal (.sent vs .fetched), threaded through UserDatabase.write to UndoManager.writeSyncChanges. This prevents redundant undo groups from CloudKit echo-backs. Add SyncRedoPolicy (.clear/.preserve) to control whether the redo stack is cleared when remote sync changes arrive, and hasSyncChangesSince(_:) so delegates can detect intervening sync changes before confirming redo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Own-zone fetched changes (echo-backs or same-user-other-device writes) no longer create sync undo groups. Only shared-zone changes from other users are recorded on the undo stack, preventing local actions from appearing as "Sync iCloud changes" entries. - Add isSharedZoneChange property to UndoGroup to track zone ownership - Add _isSharedZoneChange TaskLocal set at fetchedRecordZoneChanges based on CKCurrentUserDefaultName - Thread isSharedZoneChange through UserDatabase → writeSyncChanges → recordSyncChanges → UndoGroup - Suppress undo recording in writeSyncChanges when !isSharedZoneChange for .enabled sync undo policy - Skip Foundation bridge registration for sync groups with .preserve redo policy to prevent Foundation from clearing its redo stack - Update delegates (Reminders + Lithos) to only confirm undo for isSharedZoneChange groups - Add tests for zone-aware recording suppression and delegation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An AI assisted implementation for adding undo support to SQLiteData. I have not yet tried out all features in full, and I think some parts could/should be rewritten better: using StructuredQueries more instead of SQL directly for example. I think the overall API seems quite nice but probably needs some more refinement. Marking this as draft until I am more confident in the code once I've integrated it in my actual app.