Repository navigation
feat(ios): connection library on the core store models - #4608
Merged
Merged
Conversation
…it the unavailable codes
… pending secret cleanup
…er write already dropped it
…ore's file first holds them
datlechin
added a commit
that referenced
this pull request
Nov 26, 2026
The iOS library moved onto the core store in #4608, so its project list moves there too: LibraryWrite and the FFI library records carry projects, and a project id no project holds stays as stored.
This was referenced Nov 26, 2026
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
iOS stores chain, lane I2 (core ADRs 0010, 0054 and 0060), the connection library part.
fix/core-library-digest(e9514ab, rebased onto main as is), which feat(core): store parity for the Mac library (ids, icons, SSH/TLS fields, batch API) #4590 merged without:library_contents,replace_libraryandrebuild_libraryreturn the SHA-256 of the bytes they read or wrote, and a file the store cannot use names its problem (storage.document_corrupt,storage.document_newer_versionand the rest) instead of onestorage.document_unavailable. The iOS store tells a damaged file from a newer build's by those codes.ConnectionStoreatTableProMobile/Core/connections.jsonin Application Support: every connection field, groups, tags and favourites in one file.CoreLibraryStorereads it whole throughlibrary_contentsand writes it whole throughreplace_library.AppStatekeeps its synchronous main-actor API over that store. A write of one part carries the other two as the device holds them, so a part an earlier write left unsaved is saved too.LibraryRecordMappingmapsDatabaseConnection,ConnectionGroupandConnectionTagto the core's records and back. Each part keeps the stored value while iOS reads it as the same, so what only the Mac or the core holds comes back unchanged: the four Mac Safe Mode levels between Silent and Read-Only, TLS Preferred, Strict and server name, the SSH key's passphrase flag and hop auth, startup SQL, AI rules and policy, credential links and references, and every device setting.redisDatabasemoves betweenadditionalFieldsand the core'sredis_database. A disabled TLS with no files is no configuration, as a new connection holds it.ConnectionDeviceFlagskeeps the two iOS sync flags no core record has a field for, by id in UserDefaults: a dropped SSH profile link waiting for a pull, and an older build's SSLrequire.ConnectionKeychainSecretsis the core'sHostSecretsover the Keychain items earlier builds read. ItsdeleteConnectiondoes nothing:AppStatealready removes a deleted connection's secrets, certificates and files.LegacyLibraryMirror): an App Store build installed over a TestFlight one keeps the data, so iOS has a path back. After each core write it writesconnections.json,groups.jsonandtags.jsonthrough the existingLibraryFiles, with their backup, unreadable and pasted-SSH-key rules. It records a digest of each side.Core/connections.json.unreadableand the library comes back from those files;delete. The previous stable's readable copy of a connection the core holds unread stays in its file.Core/connections.json.unreadableand the previous stable'sconnections.json.backupand.unreadable, or writes nothing; a cleanup that failed is tried again by every later write.SSLConfigurationgainsisLegacyRequirein its init..claude/rules/data-sync-storage.md: rows for the core library, the mirror, its record and the device flags.Not in this PR:
saved-queries.jsonandquery-history.json. The FFI has no host-side API for them yet (every query and folder with its id andcreated_at, a whole write, a history entry a host ran with its error text, removal per connection), and M3 needs the same API on the Mac. They follow in their own PR.SyncRecordMapperstays until I3:IOSSyncCoordinatormaps every pushed and pulled record with it, and the core's CloudKit transport is not on main.SshJumpAuthneeds an unknown case for it.Tests changed on purpose:
AppStateLibraryTests.unsavedSyncMergeIsReportedfails the core's file instead ofconnections.json, since a failed mirror write no longer fails the save.SyncedWriteFailureTestsrefuses writes with the immutable flag on the library folder andCore/: the core resets its folder's mode before a write, so a read-only mode no longer refuses it (as M2 found on the Mac).Test plan
CoreLibraryStoreTests: first launch, a write reaching both sides, the previous stable's edit taken in, an unchanged launch, a mirror behind, half written, or stopped before its record moved, a damaged, a blank and a newer core file, changed legacy files that do not read, values only the core holds through an edit, refused writes, a removal the files did not take, the legacy copy of a core-held connection, secret copies and Mongo secrets kept out of the core, the device flags.LibraryRecordMappingTests: every iOS field round trips, Mac-only values survive an untouched write and an edit, the six Safe Mode levels, TLS Preferred, legacy require and SSL on with no configuration, groups and tags, a hop with no id.AppStateSyncWiringTests: one save removes every pending unread copy; a purge a failed write owed still runs.SSLConfigurationWireTests.legacyRequireMadeByHand.verify.sh --jobs 4 ioswith everyTableProMobileTestssuite: 2812 executed, 2812 passed. The changed suites again on the last commits: PASS.verify.sh package TableProCore TableProModelsTests: 124 passed.cargo test -p tablepro-ffi --test library_details(14 passed) andcargo test -p tablepro-storage connections(164 passed) for the digest commit on main.verify.sh linton every changed Swift file: 0 violations.uniffi-bindgen-cshad the disk for the build.