Fix RTM reconnection failure after PC resume#120
Merged
Conversation
When a PC resumes from sleep, the network may not be immediately available, causing ENOTFOUND errors that exhaust the RTM client's built-in retries. The unable_to_rtm_start handler now detects network errors and schedules automatic restarts with exponential backoff (5s, 10s, 20s, ... up to 60s cap) until the connection succeeds. Co-Authored-By: Claude Sonnet 4.6 <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
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.
Summary
ENOTFOUND slack.comエラーで RTM クライアント組み込みのリトライが尽きるとunable_to_rtm_startが発火し、以後接続が復旧しない問題を修正変更内容
isNetworkError()ヘルパーを追加:ENOTFOUND/ECONNREFUSED/ETIMEDOUT/getaddrinfoを含むエラーをネットワークエラーと判定scheduleRtmRestart()を追加: 指数バックオフ(5s → 10s → 20s → 最大 60s)でリトライをスケジュールunable_to_rtm_startハンドラでネットワークエラー検出時に自動リトライを開始authenticatedハンドラでリトライカウンタをリセット動作
Test plan
rtmRestartAttemptsがリセットされることを確認🤖 Generated with Claude Code