fix(import): detect and import the Setapp edition of TablePlus#1539
Merged
Conversation
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.
Closes #1528.
Problem
Importing from TablePlus reported "TablePlus is not installed" when the installed copy was the Setapp edition.
TablePlusImporterhardcoded the standalone edition in three places:appBundleIdentifier = "com.tinyapp.TablePlus", so the LaunchServices lookup behindinstalledAppURL()/isAvailable()never matched the Setapp bundle idcom.tinyapp.TablePlus-setapp.connectionsFileURLandgroupsFileURLwere pinned to.../com.tinyapp.TablePlus/Data/..., so even if detection passed, a Setapp user's connections (undercom.tinyapp.TablePlus-setapp/Data/) would not be read.Change
TablePlusImporteris now edition-aware, following the existingDBeaverImportermulti-edition pattern:knownBundleIdentifierslist (standalone first, then Setapp).installedAppURL()returns the first installed edition, so detection and the source-picker icon work for Setapp.connectionsFileURL/groupsFileURLare computed from the installed edition's data folder instead of a hardcoded path. A puredataDirectory(for:home:)builds the path.appBundleIdentifierstays the standalone id (canonical for registry metadata).com.tableplus.TablePlusis shared across editions, so it is unchanged.The Setapp edition is not sandboxed (its plugins live under the real
~/Library/Application Support/com.tinyapp.TablePlus-setapp/), so it mirrors the standaloneData/layout and needs no container-path handling. The Mac App Store edition's bundle id is undocumented, so it is intentionally not added.Tests
App detection and data-path resolution are now driven through injectable seams (
resolveAppURL,dataDirectoryOverride), so the cases are deterministic without a real install. Added: Setapp detection, standalone-preferred-when-both-installed, no-edition-installed, thedataDirectory(for:home:)path, andconnectionsFileURLfollowing the Setapp edition (with standalone fallback).This also fixes two pre-existing
isAvailabletests that were leftovers from before detection moved to LaunchServices (#1305): they asserted file-based availability against an app-based check, so they passed or failed depending on whether TablePlus was installed on the test runner.