fix(import): detect foreign apps via LaunchServices (#1305)#1318
Merged
Conversation
…nd scan workspaces - Add installedAppURL() to the importer protocol with a default impl that uses LaunchServices. DBeaverImporter overrides to try all four product IDs (Community/Enterprise/Ultimate/Lite) in order. - ImportFromAppSourcePicker now derives the app icon from importer.installedAppURL(). DBeaver Enterprise/Ultimate/Lite users get the correct icon instead of falling back to the SF Symbol bird. - DBeaverImporter scans ~/Library/DBeaverData/workspace* for the latest workspace dir instead of hardcoding workspace6, so workspace7 (and any future bump) works without code changes.
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
Fixes #1305. DBeaver (and TablePlus, Sequel Ace) were shown as "not installed" in the import dialog even when the app was clearly installed in
/Applications/.Root cause
All three importers' `isAvailable()` checks were probing for data files instead of the app itself:
For DBeaver this was especially bad because the path was also hardcoded to `~/Library/DBeaverData/workspace6` and would miss any user with a non-default workspace path or DBeaver Enterprise/Lite installation.
Fix
Move `isAvailable()` to a default protocol-extension implementation that uses LaunchServices via `NSWorkspace.urlForApplication(withBundleIdentifier:)`. This is Apple's documented API for asking "is an app with this bundle id installed", and it returns true as long as macOS knows about the app, regardless of whether the user has launched it or created any data.
DBeaver overrides the default to also check the Enterprise, Ultimate, and Lite product identifiers, since all DBeaver variants share the same workspace format.
The data-file check is preserved inside `importConnections` so users who click Import without data still get a clear "Could not find data files" error message instead of silent failure.
Test plan