Skip to content

refactor(logging): flush the buffered logger directly from sockets - #1144

Open
EhabY wants to merge 1 commit into
mainfrom
refactor/buffered-logger
Open

EhabY wants to merge 1 commit into
mainfrom
refactor/buffered-logger

Conversation

@EhabY

@EhabY EhabY commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Simplifies how sockets flush the connection log buffer.

The onConnectionFailure callback was threaded from the container through CoderApi.create into every ReconnectingWebSocket, even though the logger it flushed was already passed along the same path.

  • Add a BufferedLogger interface (Logger plus flush) in logger.ts, replacing ConnectionLogBuffer.
  • ReconnectingWebSocket and CoderApi take a BufferedLogger, and the socket calls flush directly on a terminal failure and once per unreachable outage.
  • getLogger() returns the BufferedLogger, so getConnectionLogBuffer() is removed.
  • Remove the callback option, its no-op default, and BufferingLogger.onConnectionFailure.

No behavior change: the flushed <reason> <route> strings are identical.

🤖 Generated with Claude Code

Replace the onConnectionFailure callback threaded through CoderApi with a
BufferedLogger type. ReconnectingWebSocket flushes the logger it already
holds, and getLogger() returns the buffered logger so
getConnectionLogBuffer() is removed.
@EhabY
EhabY requested a review from aqandrew October 8, 2026 08:27

This branch has not been deployed

No deployments
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.

1 participant