Debounce reconnect disconnect logging#1862
Conversation
- swallow replay recovery errors from resubscribe and sequence-gap retries - log WebSocket transport disconnects only once per outage
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR makes two small, self-contained improvements: deduplicating WebSocket disconnect warning logs when multiple subscriptions fail together, and properly catching errors from replay recovery to prevent unhandled promise rejections. Both changes are low-risk logging/error-handling fixes with corresponding test coverage. You can customize Macroscope's approvability policy. Learn more. |
Summary
Testing
bun fmtbun lintbun typecheckbun run testNote
Medium Risk
Touches WebSocket subscription retry/logging and orchestration replay recovery paths; mistakes could hide useful diagnostics or impact reconnection stability, but changes are small and covered by new tests.
Overview
Reduces noisy WebSocket disconnect warnings by ensuring
WsTransport.subscribelogs transport disconnect only once per reconnect window, resetting once a subscription successfully receives a value.Hardens environment orchestration recovery by scheduling replay recovery via a wrapper that swallows rejected promises (notably when triggered by
onResubscribeor sequence gaps), preventing unhandled rejection noise.Adds tests covering one-time disconnect logging when multiple subscriptions fail together and ensuring replay recovery failures during resubscribe don’t surface as unhandled rejections.
Reviewed by Cursor Bugbot for commit c61ff7a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Debounce disconnect logging and swallow replay recovery rejections in WebSocket transport
WsTransport.subscribenow emits at most one'WebSocket RPC subscription disconnected'warning per disconnect event when multiple subscriptions fail together; logging resets after the first successful message is received.createEnvironmentConnectionare now swallowed via.catch(() => undefined), preventing unhandled promise rejections during sequence-gap or resubscribe-triggered recovery.Macroscope summarized c61ff7a.