Skip to content

fix(connections): write connection files that iPhone and older Macs can open - #3685

Merged
datlechin merged 4 commits into
mainfrom
fix/ios-import-format-v2
Oct 20, 2026
Merged

datlechin merged 4 commits into
mainfrom
fix/ios-import-format-v2

Conversation

@datlechin

@datlechin datlechin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Connection files are written in format 1 whenever it holds the whole bundle, and in format 2 only for saved queries, query folders or a group inside a group. Every macOS export since 0.80 was format 2, so the iPhone app on the App Store (1.0, build 22) and Macs on 0.79 or earlier refused it with "This file requires a newer version of TablePro (format version 2)", Team Catalog files included.
  • Format 1 is written only when it reads back as the same bundle, so it never drops what format 2 keeps. Names that differ only in case, and any field format 2 gains later, keep format 2.
  • Both import sheets now stay on the passphrase step only for a wrong passphrase. A file that decrypts but needs a newer TablePro, or a corrupt or newer encrypted container, shows the error screen instead of clearing the passphrase. The codec maps only an incorrect passphrase to decryptionFailed.

Tests changed on purpose, since an empty or flat bundle is now format 1: headerIsAlwaysWritten, emptyFileDecodes (now emptyFileOpens), exportWritesCurrentFormatWithoutQueries (iOS, now exportWritesFormatOneWithoutQueries) and encryptedRoundTrip (looks up the decoded ref). A format 1 file numbers connections by position, so the iOS import tests onlyUsedGroupsAndTagsAreCreated, secondReplaceIsRefused and replaceKeepsLocalState find their rows by name instead of the refs they built. bundleWithCredentials and encryptedFileDecodesAsVersionTwo gained a saved query or a nested group so they keep testing format 2.

Docs: TableProApp/docs#54.

Test plan

  • swift test --filter TableProImportTests: 214 passed. On main, 5 of the new cases fail, among them a flat file through the frozen format 1 reader, plain and encrypted with index-keyed credentials.
  • Unit plan, ConnectionBundleExporterTests, TeamCatalogPublisherTests, WelcomeViewModelLinkedConnectionTests, WelcomeViewModelTests: 80 passed. The new Team Catalog case checks a flat connection publishes format 1 and a subgroup one format 2 with its full group path.
  • iOS: IOSConnectionImportServiceTests, IOSConnectionExportServiceTests, IOSConnectionExportFileDataTests, IOSConnectionImportIconTests, MacOnlyImportRowTests: 64 passed.

Not in this PR

  • A Mac export that includes saved queries (the default when the connections have any) or a connection in a subgroup still needs format 2, so iPhone build 22 refuses it until an iPhone build from main ships. That build already reads format 2.
  • A Team Catalog file for a connection in a subgroup stays format 2, since the file carries the full group path. Linked Folders on 0.79 or earlier skip it without a message, and that cannot change in shipped builds.

…an open

Every export since 0.80 was format 2, so iPhone build 22 and Macs on 0.79 or earlier refused it as needing a newer version. Write format 1 whenever it reads back as the same bundle, and format 2 only for saved queries, query folders or nested groups.

Both import sheets now keep the passphrase step only for a wrong passphrase; any other failure after decryption shows the error screen.
@datlechin datlechin added the backport release/0.83 Merged into main; pick onto release/0.83 label Oct 20, 2026
@datlechin
datlechin enabled auto-merge (squash) October 20, 2026 05:16
@datlechin
datlechin merged commit fe1e899 into main Oct 20, 2026
8 of 9 checks passed
@datlechin
datlechin deleted the fix/ios-import-format-v2 branch October 20, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.83 Merged into main; pick onto release/0.83

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant