Skip to content

refactor(websocket): rename onConnectionFailure to onConnectionProblem - #1143

Closed
aqandrew wants to merge 1 commit into
mainfrom
aqandrew/rename-on-connection-problem
Closed

aqandrew wants to merge 1 commit into
mainfrom
aqandrew/rename-on-connection-problem

Conversation

@aqandrew

@aqandrew aqandrew commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1132.

onConnectionFailure was a confusing name. Since #1132 the callback also fires once per outage while the socket keeps retrying against an unreachable server, so "failure" suggested the socket had given up when it hadn't (see #1132 (comment)).

Renames

Before After Where
onConnectionFailure (socket option, CoderApi param/field) onConnectionProblem reconnectingWebSocket.ts, coderApi.ts
ConnectionFailureReason ConnectionProblemReason reconnectingWebSocket.ts, coderApi.ts
NOOP_CONNECTION_FAILURE NOOP_CONNECTION_PROBLEM reconnectingWebSocket.ts
ConnectionLogBuffer.onConnectionFailure / BufferingLogger.onConnectionFailure flushForConnectionProblem logBuffer.ts, wired in extension.ts and remote.ts

The buffer side gets a verb name because it performs an action (format <reason> <route> and flush) rather than reporting an event. Its doc no longer says it only runs on a terminal failure.

Tests and mocks are updated to match. No behavior change.

Testing

  • pnpm format:check, pnpm typecheck, pnpm lint clean.
  • reconnectingWebSocket, coderApi, logBuffer, commands.telemetry, commands.supportBundle, remote suites pass.

🤖 Generated with Coder Agents on behalf of @aqandrew.

The callback also fires once per outage while the socket keeps retrying
against an unreachable server, so "failure" wrongly suggested the socket gave
up. Rename the socket option and CoderApi parameter to onConnectionProblem,
its reason type to ConnectionProblemReason, and the buffer method it is wired
to (an action, not an event) to flushForConnectionProblem. Also fix the buffer
method's doc, which still said it only runs on a terminal failure.

No behavior change.
@EhabY

EhabY commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #1144

@EhabY EhabY closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants