Fix import-desktop extracting from wrong Slack installation on macOS#60
Merged
AmethystLiang merged 2 commits intostablyai:mainfrom Mar 9, 2026
Merged
Conversation
AmethystLiang
approved these changes
Mar 9, 2026
Contributor
AmethystLiang
left a comment
There was a problem hiding this comment.
LGTM — clean, focused fix. Explicit keychain account queries + fallback + Set dedup is the right approach.
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
When both Electron (direct-download) and Mac App Store builds of Slack have been used on the same machine,
auth import-desktopcould 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). Thesecurity 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 extrasecurity find-generic-passwordcalls using the known Slack keychain account names.