Editor undo and redo changes block separation after paste #363

Closed
opened 2026-09-28 16:36:38 +00:00 by kayg · 4 comments
Owner

The adversarial editor browser probe reported that an undo/redo round trip changed the editor surface text.

Probe: tests/adversarial/editor.mjs, editor paste, Unicode, and block actions, seed 25608414. After hostile paste and block actions, the probe captured .textContent, inserted history-round-trip-186, then undid and redid. The expected and actual text differed by a missing line break between Anchor heading and parentchildsibling....

Please check whether undo/redo changes block separation or whether the browser assertion needs to compare the editor's canonical representation. This finding is outside the mobile-focus job scope. The adversarial round was under shared host load, so reproduction is needed before assigning impact.

The adversarial editor browser probe reported that an undo/redo round trip changed the editor surface text. Probe: `tests/adversarial/editor.mjs`, `editor paste, Unicode, and block actions`, seed `25608414`. After hostile paste and block actions, the probe captured `.textContent`, inserted `history-round-trip-186`, then undid and redid. The expected and actual text differed by a missing line break between `Anchor heading` and `parentchildsibling...`. Please check whether undo/redo changes block separation or whether the browser assertion needs to compare the editor's canonical representation. This finding is outside the mobile-focus job scope. The adversarial round was under shared host load, so reproduction is needed before assigning impact.
Author
Owner

The adversarial editor probe reproduced an undo/redo text mismatch on this run at seed 25608414 (editor paste, Unicode, and block actions). After the history round trip, the actual .textContent included Anchor heading parentchild...; the captured pre-history text included Anchor headingparentchild.... The probe reported undo/redo round trip changed editor text. This is a different exact diff from the issue description, under shared-host load; the editor implementation is outside this UI job's scope.

The adversarial editor probe reproduced an undo/redo text mismatch on this run at seed 25608414 (`editor paste, Unicode, and block actions`). After the history round trip, the actual `.textContent` included `Anchor heading parentchild...`; the captured pre-history text included `Anchor headingparentchild...`. The probe reported `undo/redo round trip changed editor text`. This is a different exact diff from the issue description, under shared-host load; the editor implementation is outside this UI job's scope.
Author
Owner

Adversarial evidence for the existing Editor issue: tests/adversarial/editor_chaos.py reported on seed 25608414 that undo/redo after paste, Unicode, and block actions changed block separation. The expected text had Anchor headingparentchild; the actual text had Anchor heading parentchild (three spaces inserted). This is a functional editor finding, not a UI glass-token regression. I left Editor code and assertions unchanged; this belongs with #363.

Adversarial evidence for the existing Editor issue: `tests/adversarial/editor_chaos.py` reported on seed `25608414` that undo/redo after paste, Unicode, and block actions changed block separation. The expected text had `Anchor headingparentchild`; the actual text had `Anchor heading parentchild` (three spaces inserted). This is a functional editor finding, not a UI glass-token regression. I left Editor code and assertions unchanged; this belongs with #363.
Author
Owner

Editor-integrity job final report — branch job/editor-integrity, head b824878e (pushed).

  • #332 and #364: fixed the Yrs conflict-shadow merge that discarded the surviving edit when another client deleted that block. Deterministic tests cover both update orders and a same-connection redo update. The real-server delete/edit probe passed.
  • #346: the concurrent delete/edit loss is fixed by the same change. The history-text finding is not closed by this work; see #314 and #363 below.
  • #225 and #262: added structure-level editor history coverage, but did not rerun the 500-step production browser ID storm after the final branch state. Persistence of unique IDs in that exact storm remains unconfirmed.
  • #280 and #281: the focused history test keeps one pasted image over 50 undo/redo pairs. The 500-step production browser image storm was not rerun after the final branch state, so this exact case remains unconfirmed.
  • #314 and #363: focused Yjs/ProseMirror structure tests pass. The fixed-seed production browser history probe remained timing-sensitive: clean runs reported a stale or mismatched mounted ProseMirror view after Ctrl+Z, while one instrumented run passed 50 paste and IME round trips. I removed the unverified key scheduling change and kept the failure evidence for follow-up.

Verification:

  • bun run test src/collaborationUndo.test.ts: 4 passed.
  • cargo fmt --check: exit 0, no output.
  • cargo clippy --all-targets -- -D warnings: stopped at the four-hour job limit (exit 130) while compiling workspace dependencies.
  • cargo test, bun run check, and bun run test for the full web workspace were not run before the time limit.

Decision: conflict-shadow merge filters each incoming Yrs update against that update's own delete set. This keeps a later text edit that follows a root deletion while avoiding replay of a duplicate root insertion from the same redo update. The issue-specific tests pass; the full gates and listed browser storms remain for follow-up. Issues remain open.

Editor-integrity job final report — branch `job/editor-integrity`, head `b824878e` (pushed). - #332 and #364: fixed the Yrs conflict-shadow merge that discarded the surviving edit when another client deleted that block. Deterministic tests cover both update orders and a same-connection redo update. The real-server delete/edit probe passed. - #346: the concurrent delete/edit loss is fixed by the same change. The history-text finding is not closed by this work; see #314 and #363 below. - #225 and #262: added structure-level editor history coverage, but did not rerun the 500-step production browser ID storm after the final branch state. Persistence of unique IDs in that exact storm remains unconfirmed. - #280 and #281: the focused history test keeps one pasted image over 50 undo/redo pairs. The 500-step production browser image storm was not rerun after the final branch state, so this exact case remains unconfirmed. - #314 and #363: focused Yjs/ProseMirror structure tests pass. The fixed-seed production browser history probe remained timing-sensitive: clean runs reported a stale or mismatched mounted ProseMirror view after Ctrl+Z, while one instrumented run passed 50 paste and IME round trips. I removed the unverified key scheduling change and kept the failure evidence for follow-up. Verification: - `bun run test src/collaborationUndo.test.ts`: 4 passed. - `cargo fmt --check`: exit 0, no output. - `cargo clippy --all-targets -- -D warnings`: stopped at the four-hour job limit (exit 130) while compiling workspace dependencies. - `cargo test`, `bun run check`, and `bun run test` for the full web workspace were not run before the time limit. Decision: conflict-shadow merge filters each incoming Yrs update against that update's own delete set. This keeps a later text edit that follows a root deletion while avoiding replay of a duplicate root insertion from the same redo update. The issue-specific tests pass; the full gates and listed browser storms remain for follow-up. Issues remain open.
Author
Owner

Additional reproduction for this issue from the #291 adversarial round: editor browser editor paste, Unicode, and block actions, seed 25608414, again failed after its undo/redo storm. The structural diff shows the hostile paste joined Block without an id to the next text (Block without an idhostile paste ..., missing the space) and the actual post-history state contains additional history-round-trip heading/image/anchor nodes. The probe then passed concurrent same-block writes (9,188 ms) and same-epoch offline reconciliation (20,717 ms). I left editor code and expectations unchanged; this matches the existing history mismatch and remains outside the motion-spring files.

Additional reproduction for this issue from the #291 adversarial round: `editor browser editor paste, Unicode, and block actions`, seed `25608414`, again failed after its undo/redo storm. The structural diff shows the hostile paste joined `Block without an id` to the next text (`Block without an idhostile paste ...`, missing the space) and the actual post-history state contains additional history-round-trip heading/image/anchor nodes. The probe then passed concurrent same-block writes (9,188 ms) and same-epoch offline reconciliation (20,717 ms). I left editor code and expectations unchanged; this matches the existing history mismatch and remains outside the motion-spring files.
kayg closed this issue 2026-09-29 03:38:02 +00:00
Sign in to join this conversation.
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
kayg/calternal#363
No description provided.