Skip to content

Fix import-desktop extracting from wrong Slack installation on macOS#60

Merged
AmethystLiang merged 2 commits intostablyai:mainfrom
unsafe9:fix/desktop-multi-safe-storage
Mar 9, 2026
Merged

Fix import-desktop extracting from wrong Slack installation on macOS#60
AmethystLiang merged 2 commits intostablyai:mainfrom
unsafe9:fix/desktop-multi-safe-storage

Conversation

@unsafe9
Copy link
Contributor

@unsafe9 unsafe9 commented Mar 9, 2026

Summary

When both Electron (direct-download) and Mac App Store builds of Slack have been used on the same machine, auth import-desktop could extract credentials from the wrong (stale) installation.

Root cause: Both builds store their Safe Storage password in the macOS keychain under the same service name ("Slack Safe Storage") but with different account names ("Slack Key" for Electron, "Slack App Store Key" for MAS). The security find-generic-password -w -s "Slack Safe Storage" call returns only the first match, which may belong to the inactive build — causing cookie decryption to fail for the active one and silently falling through to stale data.

Fix: Query each known account name explicitly (-a "Slack Key", -a "Slack App Store Key") before the existing service-only fallback, and deduplicate results. This adds up to 2 extra security find-generic-password calls using the known Slack keychain account names.

@unsafe9 unsafe9 changed the title Fix import-desktop when both Electron and MAS Slack coexist on macOS Fix import-desktop extracting from wrong Slack installation on macOS Mar 9, 2026
@unsafe9 unsafe9 marked this pull request as ready for review March 9, 2026 03:03
Copy link
Contributor

@AmethystLiang AmethystLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean, focused fix. Explicit keychain account queries + fallback + Set dedup is the right approach.

@AmethystLiang AmethystLiang merged commit fed532b into stablyai:main Mar 9, 2026
1 check passed
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