Repository navigation
Conversation
…nects A browser that reconnected to a running door within the reconnect window got a blank terminal, and output produced while the socket was down was dropped. Keep a bounded copy (512 Ki string units, newest kept) of the decoded terminal stream per session and send it to the reconnecting browser so the current screen is redrawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TITLE: DOS door bridge: replay recent terminal output when the browser reconnects
Problem
When a browser's WebSocket to a running DOS door drops and reconnects within
DOSDOOR_RECONNECT_TIMEOUT, the bridge reattaches the session but sends nothing until the door next writes. Output produced while the socket was down is discarded (WebSocket not ready, dropping N bytes).Impact
After a brief network blip or tab reload, the player sees a blank terminal over a still-running door and has to guess the game state or restart.
Repair
Proof
The bridge script opens its listeners and a PostgreSQL connection when it loads, so it cannot be imported into a unit test without a database. Proof is:
node --checkon the changed script;node:testharness that extracts and runs the exact append/trim statements from the file. It checks that the buffer stays within the bound and keeps the newest output, that small output is kept verbatim, and that the cut never leaves a lone low surrogate. 3/3 pass.The reconnect path change is a single
ws.send()of that buffer right after the existingsetupWebSocketHandlers()call.