socket-mode: a transient invalid_auth while reconnecting stops auto-reconnect permanently (no event emitted)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- backend, networking
Direzione di ricerca
Locate SocketModeClient and follow close → delayReconnectAttempt() → start() → retrieveWSSURL() to see where the rejected promise stops reconnection. Check the existing Socket Mode tests for initial-start and reconnect behavior, then add coverage for a transient invalid_auth during auto-reconnect and verify that retries continue or a disconnection/error event is emitted.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
After a Socket Mode connection closes, SocketModeClient stops reconnecting for good if a single apps.connections.open call returns invalid_auth (or another error the client treats as unrecoverable). The app stops receiving events, and nothing tells it so.
Slack sometimes returns invalid_auth temporarily during its own incidents. That makes a short Slack incident a permanent outage for the app until its process is restarted.
What happened
On 2026-10-22 at 16:08:41 UTC, during a period when Slack was returning HTTP 503s, two Socket Mode clients (two workspaces, two separate app tokens) reconnected at the same moment. Both got:
[ERROR] socket-mode:SocketModeClient:0 Failed to retrieve a new WSS URL (error: Error: An API error occurred: invalid_auth)
[ERROR] socket-mode:SocketModeClient:1 Failed to retrieve a new WSS URL (error: Error: An API error occurred: invalid_auth)
unhandled rejection {"code":"slack_webapi_platform_error","data":{"ok":false,"error":"invalid_auth"}}
After that, neither client made another attempt. No events arrived for 1h20. Restarting the process with the same tokens reconnected both clients immediately, so the tokens were never invalid.
Reproducible in
@slack/socket-mode2.0.7 (through@slack/bolt4.6). The same code is in 3.1.0.- Node 24.22
Code path
- The
closelistener callsthis.delayReconnectAttempt(this.start)and doesn't handle the returned promise. start()callsretrieveWSSURL(). It classifiesinvalid_auth,not_authed,account_inactive, etc., and everyRequestErrorandHTTPError, as unrecoverable, then rethrows instead of retrying.delayReconnectAttempt()runscb.apply(this).then(res)with no rejection handler. The rejection is unhandled and the client never tries again. It emits nodisconnectedor error event, so the app can't detect the dead state.
The unrecoverable classification makes sense for the first start(), where the caller awaits it and can act on a bad token. It doesn't make sense on the auto-reconnect path, where no caller can see the error.
Suggested fix (any one of these)
- While auto-reconnect is on, keep retrying unrecoverable errors in the reconnect path with backoff. A revoked token then shows up as repeated errors instead of silence.
- Or emit an event when auto-reconnect gives up (
State.Disconnectedor anerror), so apps can restart the client. - In either case, handle the promise in
delayReconnectAttempt().
Related: #2656 (another unhandled rejection from the same delayReconnectAttempt path, triggered by a different race).
- Lingua principale
- TypeScript
- Stelle
- 3.4k
- Fork
- 691
- Merge medio
- 1g 2h
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di slackapi/node-slack-sdk
-
ThreadBroadcastMessageEvent is missing `bot_id`Forse già presa @sean0407 l’ha presa 12 giorni fa. Apertauntriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
slackapi/node-slack-sdk#2766 ·
I maintainer di solito rispondono entro 1 giorno
-
SocketModeClient crashes on Events API payloads without an inner eventForse già presa @kyungyeon-byun-imweb-me l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
slackapi/node-slack-sdk#2753 ·
I maintainer di solito rispondono entro 1 giorno
-
Support assistant.search.* APIsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaauto-triage-skip enhancement pkg:web-api
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
slackapi/node-slack-sdk#2607 · 2 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
`SlackListsItem FieldMessage.message` type does not match API response shapeForse già presa @AjTheSpidey l’ha presa 163 giorni fa. Apertaarea:typescript auto-triage-skip bug pkg:web-api
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
slackapi/node-slack-sdk#2598 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Missing TypeScript response type for files.uploadV2Forse già presa @dajiaohuang l’ha presa 30 giorni fa. Apertaarea:typescript auto-triage-skip bug pkg:web-api
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
slackapi/node-slack-sdk#2459 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di slackapi/node-slack-sdk
Issue simili
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Japan Fact 898 (good-first-issue)Apertacommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
lingdojo/kana-dojo#33145 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
code-yeongyu/senpi#4278 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Activity | The activity list ignores taskIds and returns the activities of every taskForse già presa @NdekoCode l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ever-co/ever-gauzy#11469 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
griffinwork40/agent-afk#4408 ·
I maintainer di solito rispondono entro 1 giorno