fix: clear all Slack client cache on token update and disconnect#143
Merged
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom Nov 24, 2025
fix/slack-workspace-switchingbreaking-brake/cc-wf-studio:fix/slack-workspace-switchingCopy head branch name to clipboard
Merged
fix: clear all Slack client cache on token update and disconnect#143breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom fix/slack-workspace-switchingbreaking-brake/cc-wf-studio:fix/slack-workspace-switchingCopy head branch name to clipboard
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
fix/slack-workspace-switchingbreaking-brake/cc-wf-studio:fix/slack-workspace-switchingCopy head branch name to clipboard
Conversation
- Added tokenManager.clearConnection() before storeManualConnection() to match delete → create flow - Changed invalidateClient(workspaceId) to invalidateClient() to clear all cached clients - Added invalidateClient() call in SLACK_DISCONNECT handler - Ensures workspace switching works correctly when updating tokens directly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Merged
Contributor
|
🎉 This PR is included in version 2.12.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Merged
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.
Problem
When updating Slack workspace token directly (without deleting the old token first), the workspace did not switch properly.
Current Behavior
Expected Behavior
Workaround (Before Fix)
Solution
Since the delete → create flow was working correctly, we made token update flow use exactly the same implementation as the delete → create flow.
Root Cause
SlackTokenManager.storeManualConnection()only adds a new token without deleting old ones. This caused:SlackApiServiceChanges
File 1:
src/extension/commands/slack-connect-manual.tsChanges:
tokenManager.clearConnection()before storing new token to delete all existing tokensinvalidateClient(workspaceId)toinvalidateClient()to clear all WebClient cacheFile 2:
src/extension/commands/open-editor.tsChanges:
slackApiService.invalidateClient()call inSLACK_DISCONNECTmessage handlerImpact
Testing
Notes
This fix makes the token update flow use the exact same implementation as the delete → create flow. This prevents future bugs and ensures consistent behavior.