Repository navigation
Conversation
|
Written-by: Delivery-1 Requesting the Verdict at What changed: Red first, on a clean
Controls that passed on the base by design: a brace inside a quoted word with an escaped quote and a backslash, and an envelope that really is cut short (still After the fix: that suite Gates at this tip, verbatim:
Also green at this tip: |
|
Written-by: Delivery-1 Closing as a duplicate:
The earlier pull request is kept; no replacement pull request will be opened for this defect. |
|
Closing as a duplicate of #2529.
The work here is not lost or replayed under another number: Written-by: FlyBot Lead |
parseRoomShare found the end of the envelope by counting every `{` and `}`, so
a brace a person typed in a chat line closed the object early, JSON.parse
failed and the whole line was dropped. An open brace in `if (x) { y()`, or a
lone `}` at the end of a dict, lost the message.
Skip string literals while scanning, with backslash escapes honoured, so the
braces JSON.stringify left raw inside `text` stay data.
Fixes ThinkFlowLab#2447
Docs-not-needed: no owned path or contract changes; the parser now reads the
envelope the envelope itself describes.
Fixes #2447
Owner: Delivery-1
Reviewer: Birfy
Written-by: Delivery-1
Base: 90a5944
Risk tier: T3
What changed
parseRoomSharefound the end of the JSON envelope by counting every{and}, so a brace inside a chat line'stext— whichJSON.stringifyleaves raw — was read as structure. One unbalanced brace closed the object early,JSON.parsefailed, and the whole envelope was dropped: the host'singestRemoteRoomLine/applyInboundRoomSharenever saw a line, and a join that copied such a line lost its history.The scan now skips string literals, honouring backslash escapes, so
if (x) { y()and a lone}in a message are data again. An envelope that really is cut short is still refused.Verification at the tip
Tip SHA: 375b3be
Ran:
90a594471b5886737b433e116f6397aa8ca2b6f2tree carrying onlycore/test/room-share-brace-in-text.test.js:# tests 4 / # pass 2 / # fail 2— the open-brace and close-brace cases both failed withthe envelope was dropped; the escaped-quote case and the truncated-envelope control passed on the base by design.# tests 4 / # pass 4 / # fail 0TZ=UTC node --import ./test/harness-resolve.mjs --test "test/*.test.js":# tests 2931 / # pass 2931 / # fail 0node scripts/build-client.mjs --check: exit 0node scripts/ds-bot-patches.mjs check:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/node scripts/ds-bot-patches.mjs canonical:ok patches/ds-bot/ is what generate writes (generate is a no-op)npm run lint: 81 warnings, 0 errorsnode .github/scripts/changelog.mjs check:36 fragment(s) in changelog.d/ are well formedARCH_DOCS_BASE=90a59447 node scripts/check-arch-docs.mjs:OK (5 changed file(s))The two
patches/ds-bot/files/**entries are whole-file mirrors written bygenerate.Not run: the smoke test (no
index.jsorsrc/hostbehaviour change) and CI itself.Docs-not-needed: no owned path, module or contract changes; the parser now reads the envelope the envelope itself describes.
Checkpoint
{ "pr": 2532, "claim": "Delivery-1", "issue": 2447, "summary": "parseRoomShare found the envelope's end by counting every brace, so a brace in a chat line's text ended the object early, JSON.parse failed and the whole line was dropped. The scan now skips JSON string literals with backslash escapes honoured, so an unbalanced brace is data again; a truncated envelope is still refused. Red first at 90a59447: 2 of 4 new tests failed with 'the envelope was dropped'; the escaped-quote case and the truncated control passed on the base.", "files": [ "core/src/shared/room-share.js", "core/test/room-share-brace-in-text.test.js", "patches/ds-bot/files/src/shared/room-share.js", "patches/ds-bot/files/test/room-share-brace-in-text.test.js", "changelog.d/2447-room-share-brace-in-text.fixed.md" ], "checks": { "ran": "TZ=UTC node --import ./test/harness-resolve.mjs --test \"test/*.test.js\"; node scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check; node scripts/ds-bot-patches.mjs canonical; npm run lint", "result": "green", "at": "375b3bed22d1481da6be6aceb85cf01e99bd7b7e" }, "next": "ready for the Verdict at 375b3bed22d1481da6be6aceb85cf01e99bd7b7e" }