Repository navigation
fix(storage): read the iOS connection library per record and back up both apps' library as last saved - #4339
Merged
Merged
Conversation
…both apps' library as last saved
datlechin
enabled auto-merge (squash)
November 19, 2026 06:05
datlechin
disabled auto-merge
November 19, 2026 06:14
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.
Summary
From #4273:
connections.json,groups.jsonandtags.jsonall or nothing, so one record it could not read failed the whole library: no connections shown, every change refused, sync skipped, and every retry failed the same way. It now loads what decodes and writes the rest back as it was.IntegrityStampedFileStoreintoTableProConnectionLibrary(LibraryFileRecords), shared by both stores and the App Intents loader.ConnectionPersistencemoves out ofAppState.swiftbeside the group and tag persistence..claude/rules/data-sync-storage.mdcovers these files and lists the iOS backup files.Tests changed on purpose:
ConnectionStoreTagRemovalTests:saveKeepsThePreviousFileAsBackupbecomessaveMirrorsTheFileAsTheBackup;damagedFileIsRestoredFromBackup,damagedFileNeverBecomesTheBackupanduntaggedBackupIsRestoredUntrustedexpect the last saved state back.SyncLocalOnlyDependentsTests.unreadableConnectionStoreHoldsOwnedRecordsandAIConnectionAccessGateTests.undecodableStoreRefusesdelete the backup too, since a saved file now always has one.Test plan
LibraryFileRecordsTests(swift test): unread records kept verbatim, entries that are not objects, a saved record superseding a kept one, a decode-only type, non-arrays throw.AppStateLibraryTests(iOS): one bad connection, group or tag keeps the library writable and is written back; a damagedconnections.jsoncomes back as last saved with.unreadablekept; a moved SSH key leaves no copy in the backup, and stays in the file while the backup cannot be dropped; an unread preset tag is kept. Fail on main (the library is.failed).AppStateSyncWiringTests,PastedSSHKeyMigrationTests(iOS): an unread owner's saved queries are neither pushed nor deleted by a pull; keys survive records with no id and entries that are not objects.ConnectionStoreTagRemovalTests(mirror, secret-removing save that cannot drop the backup),WelcomeViewModelTests(recents and favorites order), plus the storage and sync suites around them.Refs #4273