Repository navigation
Conversation
parseRoomShare found the end of the envelope by counting braces without
tracking JSON string literals, so one { or } in a chat line's text ended the
object early and the whole envelope was dropped: the line never reached the
room. The scan now tracks strings and escapes, as the social plugin's own
envelope tail reader already does for the same shape (ThinkFlowLab#855).
Docs-not-needed: a parser fix inside a pure module; the marker contract and
every field bound are unchanged, and the module's own comment already says
ordinary chat never matches a marker.
Contributor
Author
|
Closing: our account has no write access to Owner: Delivery-1 |
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.
Written-by: Delivery-1
Owner: Delivery-1
Fixes #2447
What changed
parseRoomShare(core/src/shared/room-share.js) found the end of an envelope by counting{and}, blind to JSON strings, so a single brace in a chat line'stextended the object early,JSON.parsefailed, and the whole envelope was dropped — the line never reached the room, and a join lost the history it copied. The scan now tracks string literals and\escapes, the same algorithmplugins/social/client.jsenvelopeTailalready uses for this shape after #855.Nothing else in the module moves: no field bound, no op rule, no marker rule, and
isRoomShareTextis untouched. A balanced pair keeps its current reading, and an envelope that really is truncated still answersundefined.Docs-not-needed: a parser fix inside a pure module; the marker contract and every field bound are unchanged, and the module's own comment already says ordinary chat never matches a marker.
Verification at
6d4657cfceda931b4e619e640970a78fcf6a5009Ran:
The 7 failures are two test files that cannot pass on this box (
test/workbench-client.test.js,test/project-runtime-setup.test.js—/workspacePTY/profile and native-composer refresh cases). They fail with the same names and the same count (32 tests / 25 pass / 7 fail) when the source change is reverted, and they failed the same way on the previous three delivery branches.Not run:
npm run buildas a whole (its second step,build-workbench.mjs, needs areactinstall this box does not have;core/client.jsis not in this diff), the two plugin suites and the smoke test (no host or plugin file in this diff).Files (4, +104 / −2)
core/src/shared/room-share.js—parseRoomSharetracks strings and escapescore/test/room-share-braces.test.js— new, 6 cases (3 red on base)patches/ds-bot/files/src/shared/room-share.js,patches/ds-bot/files/test/room-share-braces.test.js— generated fromcore/Base:
delivery/ai-centric-development-serviceat5e71a07e. Branch:HugoXK:delivery1/room-share-brace-scan.maintainer_can_modify: true.Checkpoint
{ "pr": 2448, "claim": "Delivery-1", "issue": 2447, "summary": "parseRoomShare found an envelope's end by counting braces, blind to JSON strings, so one unbalanced { or } in a chat line's text made JSON.parse fail and the whole envelope was dropped — the line never reached the room. The scan now tracks string literals and backslash escapes, as plugins/social/client.js envelopeTail already does. Field bounds, op rules and markers are unchanged; a balanced pair reads as before and a truncated envelope still answers undefined. Three of the six new cases fail on base 5e71a07e.", "files": ["core/src/shared/room-share.js", "core/test/room-share-braces.test.js", "patches/ds-bot/files/src/shared/room-share.js", "patches/ds-bot/files/test/room-share-braces.test.js"], "checks": { "ran": "cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test \"test/*.test.js\"; npm run lint; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "6d4657cfceda931b4e619e640970a78fcf6a5009" }, "next": "none — ready for review" }