socket-mode: a transient invalid_auth while reconnecting stops auto-reconnect permanently (no event emitted)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- backend, networking
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.4k
- Forks
- 691
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 19
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de slackapi/node-slack-sdk
-
ThreadBroadcastMessageEvent is missing `bot_id`Posiblemente ocupada @sean0407 la tomó hace 13 días. Abiertountriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
slackapi/node-slack-sdk#2766 ·
Los mantenedores suelen responder en 1 día
-
SocketModeClient crashes on Events API payloads without an inner eventPosiblemente ocupada @kyungyeon-byun-imweb-me la tomó hace 25 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
slackapi/node-slack-sdk#2753 ·
Los mantenedores suelen responder en 1 día
-
Support assistant.search.* APIsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoauto-triage-skip enhancement pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
slackapi/node-slack-sdk#2607 · 2 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
`SlackListsItem FieldMessage.message` type does not match API response shapePosiblemente ocupada @AjTheSpidey la tomó hace 164 días. Abiertoarea:typescript auto-triage-skip bug pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
slackapi/node-slack-sdk#2598 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Missing TypeScript response type for files.uploadV2Posiblemente ocupada @dajiaohuang la tomó hace 31 días. Abiertoarea:typescript auto-triage-skip bug pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
slackapi/node-slack-sdk#2459 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de slackapi/node-slack-sdk
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
ajv-validator/ajv#2689 ·
-
[Bug]: IME confirmation Enter can submit the SSH port-forward dialogPosiblemente ocupada @seijikohara la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
home-assistant/frontend#55323 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
lingdojo/kana-dojo#33188 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
self-driving
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día