Skip to content

feat(core): Team Library connections cross as library records, and every Team Library call names its owner - #4661

Merged
datlechin merged 2 commits into
mainfrom
feat/core-team-library-records
Nov 27, 2026
Merged

datlechin merged 2 commits into
mainfrom
feat/core-team-library-records

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • The core maps a Team Library connection between the Mac's bundle (ExportableConnection) and a saved connection, one way for every platform: tablepro_sync::adapters::library::{team_bundle, team_connection}. A bundle is written as ConnectionBundleExporter.teamShareableSettings writes it and read as DatabaseConnection(importing:) reads it.
  • The rules: the record names its driver the host's way and the bundle the Mac's way; home paths go out as ~/ and are expanded on read; what the bundle has no place for (tags, group, project, favourite, credential profile, device settings) reads as the default; startup commands, a tunnel command and Local only never go out and are ignored on read; a copy links only an SSH profile this device holds.
  • Driver fields go through field_trust::portable_fields both ways, as the Mac exporter does, so a field no file may carry never reaches a team.
  • A copy whose tunnel or jump host would read as an ssh option reads as no connection, as the Mac refuses it on import.
  • SyncService::publish_team_connections takes LibraryConnectionRecords and builds each bundle; TeamConnectionArg is gone. TeamLibraryItemInfo.connection is a connection item read as a LibraryConnectionRecord.
  • SyncService::team_library_owner() gives the owner the service's TablePro Sync sign-in binds Team Library to.
  • Every Team Library call takes expected_owner and is refused with sync.team_library.other_owner on another owner's engine, so a call started for one account never lands on the next one's library. A sign-in-bound call still checks that the sign-in holds after every await.
  • C# bindings regenerated.

Test plan

  • core/crates/sync/src/adapters/library/bundle_tests.rs: bundles as the Mac builder writes them (a plain connection, and one with every member away from its default) read and go back out unchanged; the read fills the saved connection's members; a team copy drops startup and tunnel commands and links only a held profile; a blank host, an unknown TLS mode and legacy timeouts read as the Mac imports them; the core's driver ids map to the Mac's type names; a switched-off tunnel and disabled TLS stay out; a driver field no file may carry stays out both ways.
  • core/crates/ffi/src/sync/team_library.rs tests: a published record goes as the Mac's bundle and a bad id is refused; a connection item reads as a library connection and a query as none; a copy whose tunnel host is an option reads as no connection; a call for another owner is refused and either spelling of this one passes.
  • Local: sync and ffi tests and clippy on macOS; storage and sync tests and clippy in the Linux container; Windows bindings regenerated and the Windows build passes.

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