Skip to content

refactor(logging): flush the flight recorder directly from sockets - #1144

Merged
EhabY merged 2 commits into
mainfrom
refactor/buffered-logger
Oct 9, 2026
Merged

EhabY merged 2 commits 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, and renames the buffer to match the flight recorder naming in coder/slog.

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.

No behavior change: the flushed <reason> <route> strings are identical, and the coder.connectionLogBuffer.size setting and [buffered] output marker are unchanged.

🤖 Generated with Claude Code

@EhabY
EhabY requested a review from aqandrew October 8, 2026 08:27
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 force-pushed the refactor/buffered-logger branch 2 times, most recently from 0cf4336 to eb6d2ed Compare October 9, 2026 14:48

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! As an aside, we have been calling this a "flight recorder" rather than a "buffered logger" in other repos (since "buffered" could have other meanings), might make sense to match that name in this repo one day.

@aqandrew aqandrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler, thanks!

Also +1 to Asher's comment re: suggesting renaming "buffered logger" to "flight recorder". See these PRs:

Match the flight recorder naming from coder/slog. Logger now carries
flush, so consumers take a plain Logger again; the write-only side
(output channel, prefixLogger) becomes LogSink. BufferingLogger is
renamed to FlightRecorder and is only named where it is constructed.
Comment thread src/deployment/deploymentManager.ts
@EhabY EhabY changed the title refactor(logging): flush the buffered logger directly from sockets refactor(logging): flush the flight recorder directly from sockets Oct 9, 2026
@EhabY
EhabY merged commit 72d2975 into main Oct 9, 2026
15 checks passed
@EhabY
EhabY deleted the refactor/buffered-logger branch October 9, 2026 21:50
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.

3 participants