Skip to content

Fix auth import-desktop when multiple Slack installations exist#59

Merged
AmethystLiang merged 1 commit intostablyai:mainfrom
unsafe9:fix/import-desktop-multiple-paths
Mar 8, 2026
Merged

Fix auth import-desktop when multiple Slack installations exist#59
AmethystLiang merged 1 commit intostablyai:mainfrom
unsafe9:fix/import-desktop-multiple-paths

Conversation

@unsafe9
Copy link
Contributor

@unsafe9 unsafe9 commented Mar 8, 2026

Summary

  • auth import-desktop failed with "Could not locate xoxd-*" when both Electron and Mac App Store Slack data directories existed, because it only tried the first one found (Electron) even if its cookie couldn't be decrypted
  • Changed getSlackPaths()getAllSlackPaths() to return all valid candidate paths, and extractFromSlackDesktop() now tries each until one fully succeeds (both LevelDB teams and cookie decryption)
  • Error message now reports all attempted paths and their individual failures

Verified on my machine where the command previously failed.

Previously, getSlackPaths() returned only the first Slack data directory
found. On macOS, if both the Electron (~/Library/Application Support/Slack)
and App Store (~/Library/Containers/com.tinyspeck.slackmacgap/...) directories
existed, the Electron path was always picked — even if its cookie could not
be decrypted (e.g. stale data from a previous installation).

Now getAllSlackPaths() returns all valid candidate paths, and
extractFromSlackDesktop() tries each one until both LevelDB team extraction
and cookie decryption succeed. The error message now reports all attempted
paths with their individual failures.
@AmethystLiang
Copy link
Contributor

AI Review (Claude Opus 4.6)

Verdict: Approve

Clean, well-scoped fix. The approach of trying all candidate paths and collecting errors is correct.

What looks good

  • Minimal change — only touches the affected file
  • Good error reporting — aggregates failures from all attempted paths
  • No changes to public API surface

Commit pushed

  • Added stderr debug log when a Slack data path is skipped during fallback, so users can see which paths were tried and why they failed in real-time (not just in the final error).

LGTM — merging.

@AmethystLiang AmethystLiang merged commit 957e783 into stablyai:main Mar 8, 2026
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.

2 participants