You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three fixes to the Slack connector, surfaced while reviewing it against the Slack Marketplace app guidelines.
files:write scope was missing
Both Slack link types advertise supportsFileAttachments, and onNoteCreated uploads attachments via files.getUploadURLExternal / files.completeUploadExternal — but files:write was never in the connector's declared scopes. So attachment uploads failed with missing_scope and the file was silently dropped (the text of the message still sent). This declares the scope.
Note: existing connections must reconnect to grant the new scope. The upload path already degrades gracefully (logs and continues) when the scope is absent.
Deauthorization events were ignored
onSlackWebhook now handles app_uninstalled (workspace admin removes the app) and tokens_revoked (a user revokes their token from Slack). Both flag the affected connection for re-authentication immediately, instead of the connection only discovering the dead token lazily on its next API call.
tokens_revoked fans out to every callback registered for the workspace, so it is gated on the connection's own Slack user id — a teammate revoking their token never tears down another user's still-valid connection.
Delivery requires enabling app_uninstalled / tokens_revoked in the Slack app's Event Subscriptions.
Scope JSDoc was stale
The class doc comment listing scopes had drifted from the authoritative SCOPES array (missing im:write, mpim:write, reactions:read/reactions:write). Updated to match, with a one-line justification per scope.
Testing
tsc + build clean.
Added onSlackWebhook deauthorization tests (app_uninstalled, own-user tokens_revoked, and the teammate-revoke no-op). Full connector suite passes (31 tests).
Declare the `files:write` user scope. Both link types advertise
`supportsFileAttachments` and onNoteCreated uploads attachments via
files.getUploadURLExternal / files.completeUploadExternal, but the scope was
never declared — so those uploads failed with `missing_scope` and the
attachment was silently dropped (the text message still sent). Existing
connections must reconnect to grant the scope; the upload path already degrades
gracefully when it is absent.
Handle Slack `app_uninstalled` and `tokens_revoked` events in onSlackWebhook by
flagging the connection for re-authentication, so a workspace uninstall or a
user revoking their token from Slack is reflected right away instead of only on
the next failing API call. `tokens_revoked` is gated on the connection's own
Slack user id, so an event that fans out to every callback for the team never
tears down other users who are still connected. Delivery requires enabling
these events in the Slack app's Event Subscriptions.
Correct the class JSDoc scope list to match the authoritative SCOPES array
(it had omitted im:write, mpim:write, and reactions:read/write) and add a
one-line justification per scope.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
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.
What
Three fixes to the Slack connector, surfaced while reviewing it against the Slack Marketplace app guidelines.
files:writescope was missingBoth Slack link types advertise
supportsFileAttachments, andonNoteCreateduploads attachments viafiles.getUploadURLExternal/files.completeUploadExternal— butfiles:writewas never in the connector's declared scopes. So attachment uploads failed withmissing_scopeand the file was silently dropped (the text of the message still sent). This declares the scope.Note: existing connections must reconnect to grant the new scope. The upload path already degrades gracefully (logs and continues) when the scope is absent.
Deauthorization events were ignored
onSlackWebhooknow handlesapp_uninstalled(workspace admin removes the app) andtokens_revoked(a user revokes their token from Slack). Both flag the affected connection for re-authentication immediately, instead of the connection only discovering the dead token lazily on its next API call.tokens_revokedfans out to every callback registered for the workspace, so it is gated on the connection's own Slack user id — a teammate revoking their token never tears down another user's still-valid connection.Delivery requires enabling
app_uninstalled/tokens_revokedin the Slack app's Event Subscriptions.Scope JSDoc was stale
The class doc comment listing scopes had drifted from the authoritative
SCOPESarray (missingim:write,mpim:write,reactions:read/reactions:write). Updated to match, with a one-line justification per scope.Testing
tsc+ build clean.onSlackWebhookdeauthorization tests (app_uninstalled, own-user tokens_revoked, and the teammate-revoke no-op). Full connector suite passes (31 tests).🤖 Generated with Claude Code