Skip to content

fix(import): detect foreign apps via LaunchServices (#1305)#1318

Merged
datlechin merged 2 commits into
mainfrom
fix/1305-importer-detection
May 18, 2026
Merged

fix(import): detect foreign apps via LaunchServices (#1305)#1318
datlechin merged 2 commits into
mainfrom
fix/1305-importer-detection

Conversation

@datlechin
Copy link
Copy Markdown
Member

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:

  • TablePlus: `fileExists(connectionsFileURL)` — false until user opens TablePlus once
  • Sequel Ace: `fileExists(favoritesFileURL)` — false until user has a favorite
  • DBeaver: `findDataSourcesFile() != nil` — false until user opens a workspace

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

  • Install fresh DBeaver, do not open it → appears as available in the import dialog
  • Install fresh TablePlus, do not open it → appears as available
  • Install fresh Sequel Ace, do not open it → appears as available
  • Uninstall all three → all hidden from import dialog
  • DBeaver Enterprise / Ultimate installed → still detected

datlechin added 2 commits May 18, 2026 15:16
…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.
@datlechin datlechin merged commit 5197b0e into main May 18, 2026
2 checks passed
@datlechin datlechin deleted the fix/1305-importer-detection branch May 18, 2026 08:23
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.

Import: DBeaver installation not detected on MacOS

1 participant