socket-mode: a transient invalid_auth while reconnecting stops auto-reconnect permanently (no event emitted)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 3.4k
- Fork
- 691
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của slackapi/node-slack-sdk
-
ThreadBroadcastMessageEvent is missing `bot_id`Có thể đã có người làm @sean0407 đã nhận 12 ngày trước. Đang mởuntriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
slackapi/node-slack-sdk#2766 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SocketModeClient crashes on Events API payloads without an inner eventCó thể đã có người làm @kyungyeon-byun-imweb-me đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
slackapi/node-slack-sdk#2753 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support assistant.search.* APIsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởauto-triage-skip enhancement pkg:web-api
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
slackapi/node-slack-sdk#2607 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`SlackListsItem FieldMessage.message` type does not match API response shapeCó thể đã có người làm @AjTheSpidey đã nhận 163 ngày trước. Đang mởarea:typescript auto-triage-skip bug pkg:web-api
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
slackapi/node-slack-sdk#2598 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Missing TypeScript response type for files.uploadV2Có thể đã có người làm @dajiaohuang đã nhận 30 ngày trước. Đang mởarea:typescript auto-triage-skip bug pkg:web-api
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
slackapi/node-slack-sdk#2459 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của slackapi/node-slack-sdk
Issue tương tự
-
Native Web
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
digitalfabrik/integreat-app#4517 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TLS guide repeats certs/ in the certificate directoryCó thể đã có người làm @maheshrijal đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
prometheus/docs#3156 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
medusajs/dtc-starter#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
usability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
inmanta/web-console#7632 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zaidmukaddam/scira#261 ·