feat(desktop): add Connection log popout for handshake diagnosis #88

Merged
Claude-Run merged 1 commit from feat/VAPP-76-connection-log-popout into main 2026-07-07 12:52:11 +02:00
Member

A "server says connected but the display is black" desktop session was only diagnosable by opening the browser devtools console, where every relay / WebRTC / framing diagnostic is written. The relay WebSocket's own onopen/onerror were never surfaced at all: the error slot was only ever cleared to None, so a relay WS error was invisible in the UI. This adds an on-screen, opt-in log of the desktop connection lifecycle so the failure is self-diagnosable without devtools.

A process-global ring buffer (cap 500, oldest dropped) records every connection-path event: the tunnel request/response legs, the relay WS open/close (with code/reason)/error, the rendezvous handshake, the WebRTC answer and webrtc0/webrtc1 signalling, the Direct/Relayed switchover, the first relay payload, the first screen-size frame, the tile-before-size (canvas unsized) warning, framing desync, and the RTC/decode failures. Each entry carries a timestamp, a direction category (agent->browser / browser->agent / local), and a message; the relay url stays redacted exactly as it already is in console output. The existing console calls are kept, the buffer is purely additive.

A "Connection log" toolbar button next to Detach/Refresh opens the buffer in a separate window.open popout (reusing the VAPP-75 popout primitive), rendering entries newest-last and appending live while open, with a Copy button that copies the whole buffer as plain text. The popout is torn down cleanly by reusing install_closed_poll plus a pagehide listener and a closed latch, so no interval or listener outlives it; teardown also closes it. A real ws.set_onerror handler is now installed in build. The buffer, its plain-text export, and the timestamp formatter are pure and host-tested; the VAPP-70/75 source guard is extended to fail the build if the error handler or the toolbar button regress.

#VAPP-76

A "server says connected but the display is black" desktop session was only diagnosable by opening the browser devtools console, where every relay / WebRTC / framing diagnostic is written. The relay WebSocket's own onopen/onerror were never surfaced at all: the error slot was only ever cleared to None, so a relay WS error was invisible in the UI. This adds an on-screen, opt-in log of the desktop connection lifecycle so the failure is self-diagnosable without devtools. A process-global ring buffer (cap 500, oldest dropped) records every connection-path event: the tunnel request/response legs, the relay WS open/close (with code/reason)/error, the rendezvous handshake, the WebRTC answer and webrtc0/webrtc1 signalling, the Direct/Relayed switchover, the first relay payload, the first screen-size frame, the tile-before-size (canvas unsized) warning, framing desync, and the RTC/decode failures. Each entry carries a timestamp, a direction category (agent->browser / browser->agent / local), and a message; the relay url stays redacted exactly as it already is in console output. The existing console calls are kept, the buffer is purely additive. A "Connection log" toolbar button next to Detach/Refresh opens the buffer in a separate window.open popout (reusing the VAPP-75 popout primitive), rendering entries newest-last and appending live while open, with a Copy button that copies the whole buffer as plain text. The popout is torn down cleanly by reusing install_closed_poll plus a pagehide listener and a closed latch, so no interval or listener outlives it; teardown also closes it. A real ws.set_onerror handler is now installed in build. The buffer, its plain-text export, and the timestamp formatter are pure and host-tested; the VAPP-70/75 source guard is extended to fail the build if the error handler or the toolbar button regress. #VAPP-76
feat(desktop): add Connection log popout for handshake diagnosis
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m23s
Create release / Create release from merged PR (pull_request) Has been skipped
c237fc0899
A "server says connected but the display is black" desktop session was only diagnosable by opening the browser devtools console, where every relay / WebRTC / framing diagnostic is written. The relay WebSocket's own onopen/onerror were never surfaced at all: the error slot was only ever cleared to None, so a relay WS error was invisible in the UI. This adds an on-screen, opt-in log of the desktop connection lifecycle so the failure is self-diagnosable without devtools.

A process-global ring buffer (cap 500, oldest dropped) records every connection-path event: the tunnel request/response legs, the relay WS open/close (with code/reason)/error, the rendezvous handshake, the WebRTC answer and webrtc0/webrtc1 signalling, the Direct/Relayed switchover, the first relay payload, the first screen-size frame, the tile-before-size (canvas unsized) warning, framing desync, and the RTC/decode failures. Each entry carries a timestamp, a direction category (agent->browser / browser->agent / local), and a message; the relay url stays redacted exactly as it already is in console output. The existing console calls are kept, the buffer is purely additive.

A "Connection log" toolbar button next to Detach/Refresh opens the buffer in a separate window.open popout (reusing the VAPP-75 popout primitive), rendering entries newest-last and appending live while open, with a Copy button that copies the whole buffer as plain text. The popout is torn down cleanly by reusing install_closed_poll plus a pagehide listener and a closed latch, so no interval or listener outlives it; teardown also closes it. A real ws.set_onerror handler is now installed in build. The buffer, its plain-text export, and the timestamp formatter are pure and host-tested; the VAPP-70/75 source guard is extended to fail the build if the error handler or the toolbar button regress.

#VAPP-76
Claude-Run deleted branch feat/VAPP-76-connection-log-popout 2026-07-07 12:52:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!88
No description provided.