Repository navigation
fix(brainstorming): keep visual companion server alive on fs errors - #2764
Open
Sakibpedia wants to merge 1 commit into
Open
Sakibpedia wants to merge 1 commit into
Sakibpedia wants to merge 1 commit into
Conversation
danishkumar26
left a comment
There was a problem hiding this comment.
Reviewed. Persistence gate now keeps falsy choices (event.choice !== undefined && !== null), event and file read failures become logged errors or 500 responses instead of server crashes, and unknown arguments plus the killed-server message are JSON-escaped in start-server.sh.
Companion note: PR #2761 on dev fixes the same dropped-choice-event bug from the server side by normalizing choice-shaped events there; both approaches converge on the same persisted event shape.
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.
Fixes #2757 (visual companion crash + JSON escaping).
Changes:
server.cjs: wrap request handler in try/catch so a failing fs call (e.g. unreadable/replaced screen file) returns 500 instead of killing node; read file beforewriteHead; guardappendFileSync/unlinkSync; change choice check to!== undefined && !== null.helper.js: includechoicefield in choice events.start-server.sh: addjson_escapeand use it in both error JSON outputs.All three files pass syntax checks (
node --check,bash -n).