Skip to content

feat(core): store parity for the Mac library (ids, icons, SSH/TLS fields, batch API) - #4590

Merged
datlechin merged 11 commits into
mainfrom
feat/core-store-mac-parity
Nov 26, 2026
Merged

datlechin merged 11 commits into
mainfrom
feat/core-store-mac-parity

Conversation

@datlechin

@datlechin datlechin commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Core store parity for the Mac library (lane K4c of the full-sync work), so the Mac's library moves into connections.json without losing ids or values.

Core and storage

  • ConnectionStore::replace_library_blocking(LibraryWrite { connections, groups, tags, favorites }): the whole library in one commit and one journal call, ids and values as given, a repeated id refused (storage.repeated_id), entries this build cannot read kept unless the write names them.
  • Reads and writes keep stored values: no renumbering, rooting, name cleaning or tag merging. An upsert replaces the entry where the list holds it, so entries of one order keep their places. A missing or cyclic parent and a missing group read as the top level (GroupTree::parent, ConnectionList::group_of); a missing tag reads as none; delete_tag_blocking takes the tag off its connections itself.
  • Group, tag and connection names are kept as written. Edits (ConnectionGroupName::new, ConnectionTagName::new, the FFI save and rename, the Linux form) and file imports still clean them; shown() and same_name compare and display the cleaned form.
  • LibraryIcon (was GroupIcon) on connections too: a named icon or an SF Symbol. A named connection icon is still written as its id string.
  • SavedSshConfig: enabled (settings kept while off), SshJumpHost hops (the legacy user@host:port string still read and written while a hop has no id, auth or key), SavedSshAuth::None, kept_key_path, agent_socket, totp, remote_file, unknown. SshProfile's unknown keys move into its ssh.
  • TlsMode::VerifyCa, refused by TlsConfig::validate and listed by no driver; matches that reach it anyway check the name too. TlsConfig.unknown.
  • AiPolicy::AppDefault with or_app_default; ConnectionTag.is_preset; ConnectionTag.color optional.
  • SafeModeLevel is the Mac's six levels: Silent, Alert, AlertFull, SafeMode, SafeModeFull, ReadOnly. The first three keep their stored names (off, confirm_writes, read_only). SafeModeLevel::enforced rounds up, never down, to the three a session runs today, so AlertFull, SafeMode and SafeModeFull run as Read-Only on Linux and Windows; resolve_saved and Session::set_safe_mode run the enforced level.
  • ADR 0060: ChangeJournal::changed(&[JournalEntry]) names, per kind, the records each commit wrote and deleted (RecordRef: UUID, team item, table, database), for every store; saved queries, folders and history entries go by the record_id feat(core): UUID record ids for synced kinds #4587 gave them, renumbered siblings included.
  • Connect: a switched-off tunnel is not dialed; a hop with its own key is refused (SshDestinationProblem::JumpHostKey); a tunnel to a remote file is refused for every engine (ConfigError::RemoteFileOverSsh); none auth dials as the agent, since both transports try none first.
  • TlsMode::at_least_in: a form shows a mode its engine does not offer as the weakest offered one at least as strict (Verify CA as Verify full), never the engine's weaker default. TlsMode::edited: saving the mode it shows keeps the stored one.
  • MCP: lists, errors and write approvals name a connection as it shows; list_connections gives the Safe Mode level a session runs.
  • An edit keeps a group link that has not arrived, and a move changes only the moved entries' group or parent; group moves, renames, name checks and file imports use the tree's parent, so an orphan or a cycle reorders and matches at the top, and a move at the top lifts a cycle partner out; a file import compares connection and group names as they show.
  • Opening a local file never matches a saved tunnel to a file on the SSH host.
  • Records: the model table and the exhaustive destructures class every new member.

FFI

  • ConnectionLibrary::library_contents() and replace_library(LibraryWriteRecord) with LibraryConnectionRecord { connection, details, device }; unknown keys, network options and route unknowns stay from the stored entry.
  • ConnectionRecord.icon, .order; GroupRecord.icon; TagRecord.is_preset, optional color; update_tag takes an optional colour; SshSettings.enabled, .options (SshOptionsRecord), jump_hosts: Vec<SshJumpHostRecord>; TlsModeTag::VerifyCa; AiPolicyTag::AppDefault; SshAuthTag::None; SafeModeTag six levels.
  • parse_jump_hosts, jump_hosts_text, safe_mode_enforced, library_icon_for_symbol, library_icon_symbol.
  • A form save keeps what the form does not show: stored SSH options, hop ids and keys, None auth, a symbol icon, a group that has not arrived, a tunnel to a remote file, the stored Safe Mode level when the form sends its enforced value, App Default when it sends Ask, a stored TLS mode when the form sends it rounded up. A save that carries a tunnel turns it on. Names are cleaned before the empty check, duplicate too.
  • The snapshot shows names as the list shows them; library_contents gives them as stored.

Linux

  • The form and menus offer Off, Confirm Writes and Read-Only, showing a macOS-only level as the one it runs; AI policy offers three and shows App Default as Ask Each Time; TLS shows Verify CA as Verify full; saving what they show keeps the stored value.
  • TLS shows a mode the engine does not offer rounded up.
  • Rows, tab titles, the sidebar, group paths, delete and rename dialogs, tag rows and menus, link and history dialogs show names cleaned; renaming a tag with no colour keeps it colourless.
  • A TLS mode chosen and then rounded up stays chosen, so a port change cannot drop it to a weaker default (Windows too).
  • A switched-off tunnel keeps its settings; an edit keeps the tunnel's hidden settings, hop ids and None auth, and the TLS settings' unknown keys.
  • Tags with no colour, Verify CA, the new SSH and config refusals worded; linux/docs/storage.md updated.

Windows

  • Interop maps the six levels to the three it shows through safe_mode_enforced, VerifyCa, App Default as Ask, a switched-off tunnel as none, hops through parse_jump_hosts and jump_hosts_text, tags with no colour (UpdateTagAsync takes an optional colour).
  • The form shows a TLS mode the engine does not offer rounded up (TlsModes.AtLeastIn), never the first in the list.
  • Bindings regenerated with uniffi-bindgen-cs 0.11.1+v0.31.0.

Tests updated on purpose

  • catalog_change and safe_mode_gate: the gate tables cover six levels.
  • connection_group, connection_tag, the names' stored-form tests: stored names are kept, not cleaned or refused.
  • group_tree cycle test: a cycle now reads at the top.
  • Storage: a_crafted_tree_reads_without_cycles_strays_or_doubles, a_name_is_stored_as_given (was a_rename_is_stored_as_the_list_shows_it), a_connection_names_each_tag_once_and_keeps_one_the_list_lacks, a_file_with_a_doubled_tag_reads_its_first_entry_and_keeps_a_namesake, a_tag_with_a_blank_name_is_kept_as_written, and the insert-after test's tag assertion: stored values are kept, not rewritten.
  • FFI a_mysql_read_script_with_delimiter_lines_runs_at_every_level_that_lets_reads_through: the Full levels ask before reads.
  • Swift CloudLibraryRecordsTests in apple/Packages/TableProFFI: it saves at .silent, the level .off became.
  • Linux connect_form driver-switch test: the default taken for a chosen mode stays chosen.
  • Linux a_renumbering_write_keeps_the_objects: a delete keeps the other entries' numbers; the move still renumbers.
  • Linux safe_mode_subtitle_follows_the_level_and_the_enforcement and each_ai_policy_says_what_it_sends: they walk the levels and policies the pickers offer.

Test plan

  • Linux dev container, verify.sh --platform linux --jobs 3, on the merge with main: lint, build and every Meson suite pass, 9523 cases, tablepro-storage and tablepro-records among them (macOS's SQLite 3.54 fails the history.db copy tests).
  • macOS: cargo test for tablepro-core and tablepro-mcp; verify.sh --platform windows core for tablepro-ffi, 389 cases.
  • Windows steps from macOS, verify.sh --platform windows --jobs 4: build (the WinUI projects compile only), test 2507 cases, bindings match the library.
  • apple/scripts/ci/check-connection-field-trust.py passes.
  • Merged with --admin before the CI queue, on Dat's rule of 2026-11-26 for this work (main's CI runs after the merge; red is fixed forward).
  • Reviews, Claude (fresh agent): a review and a security pass of the branch, a review of those fixes (two high findings, fixed), a review of the second fixes (two medium and three low, fixed).

@datlechin
datlechin enabled auto-merge (squash) November 25, 2026 23:03
…arity

# Conflicts:
#	core/crates/storage/src/query_history/mod.rs
#	core/crates/storage/src/saved_queries/deletion.rs
#	core/crates/storage/src/saved_queries/folders.rs
#	core/crates/storage/src/saved_queries/mod.rs
#	core/crates/storage/src/saved_queries/ordering.rs
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
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.

1 participant