Adversarial editor undo/redo round trip loses note text #314

Closed
opened 2026-09-28 08:00:09 +00:00 by kayg · 5 comments
Owner

Finding

The local adversarial editor probe found note text loss during an undo/redo round trip after hostile paste, IME input, and block actions. This was observed on job/glass at merged head a4b7de62, with seed 25608414, in the browser editor paste, Unicode, and block actions area of tests/adversarial/editor.mjs.

The probe inserted history-round-trip-186, captured the editor text, then ran Ctrl+Z and Ctrl+Shift+Z. The equality check failed.

Expected ending:

Anchor heading  parentchildsiblingfinal-marker first-marker start

Actual ending:

Anchor headingparentchildsiblingfinal-markerirst-marker start

This loses spacing and the first character of first-marker. The failure path overlaps the editor history changes merged from dev (including 0b4b68e1, “fix(editor): isolate paste and IME history groups”), but the root cause is unconfirmed. Please investigate the history transaction handling and keep the current equality expectation.

## Finding The local adversarial editor probe found note text loss during an undo/redo round trip after hostile paste, IME input, and block actions. This was observed on `job/glass` at merged head `a4b7de62`, with seed `25608414`, in the `browser editor paste, Unicode, and block actions` area of `tests/adversarial/editor.mjs`. The probe inserted ` history-round-trip-186`, captured the editor text, then ran Ctrl+Z and Ctrl+Shift+Z. The equality check failed. Expected ending: ```text Anchor heading parentchildsiblingfinal-marker first-marker start ``` Actual ending: ```text Anchor headingparentchildsiblingfinal-markerirst-marker start ``` This loses spacing and the first character of `first-marker`. The failure path overlaps the editor history changes merged from `dev` (including `0b4b68e1`, “fix(editor): isolate paste and IME history groups”), but the root cause is unconfirmed. Please investigate the history transaction handling and keep the current equality expectation.
Author
Owner

Repeated evidence from the #303 adversarial run: tests/adversarial/editor.mjs, seed 25608414, browser editor paste, Unicode, and block actions. The undo/redo round trip changed text after hostile paste, IME input and block actions. The actual text kept three spaces after Anchor heading; the captured text had no spaces there. The probe still fails its existing equality expectation. This run's result is less destructive than the loss recorded in this issue, but confirms the history mismatch.

Repeated evidence from the #303 adversarial run: `tests/adversarial/editor.mjs`, seed `25608414`, `browser editor paste, Unicode, and block actions`. The undo/redo round trip changed text after hostile paste, IME input and block actions. The actual text kept three spaces after `Anchor heading`; the captured text had no spaces there. The probe still fails its existing equality expectation. This run's result is less destructive than the loss recorded in this issue, but confirms the history mismatch.
Author
Owner

Additional evidence from the single post-merge adversarial round for #319:

  • Branch: job/single-pills, head 46497b6a7c03eb02a7cbbbfac3f36b563c906af7.
  • tests/adversarial/run.sh produced the same failure in the browser editor paste/Unicode/block-actions probe, seed 25608414.
  • After paste, IME and block actions, the Ctrl+Z/Ctrl+Shift+Z round trip changed the saved editor text. The actual text lost spaces around the joined heading text and dropped the initial f from first-marker; the equality expectation failed.
  • Other cargo and adversarial workloads were active on the shared host. This one run does not establish the cause.

This matches the history corruption already recorded here; the current equality expectation was kept unchanged.

Additional evidence from the single post-merge adversarial round for #319: - Branch: `job/single-pills`, head `46497b6a7c03eb02a7cbbbfac3f36b563c906af7`. - `tests/adversarial/run.sh` produced the same failure in the browser editor paste/Unicode/block-actions probe, seed `25608414`. - After paste, IME and block actions, the Ctrl+Z/Ctrl+Shift+Z round trip changed the saved editor text. The actual text lost spaces around the joined heading text and dropped the initial `f` from `first-marker`; the equality expectation failed. - Other cargo and adversarial workloads were active on the shared host. This one run does not establish the cause. This matches the history corruption already recorded here; the current equality expectation was kept unchanged.
Author
Owner

Additional real-server browser evidence from job/money-format at merged head 25e88ffccbab8e1cc41a67ddbc08ec9d5ccff050: the existing editor paste, Unicode, and block-action undo/redo equality check failed again with seed 25608414. This was during the time-boxed browser action storm. It independently reproduces the note-text mismatch already described here; no cause is established.

Additional real-server browser evidence from `job/money-format` at merged head `25e88ffccbab8e1cc41a67ddbc08ec9d5ccff050`: the existing editor paste, Unicode, and block-action undo/redo equality check failed again with seed `25608414`. This was during the time-boxed browser action storm. It independently reproduces the note-text mismatch already described here; no cause is established.
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

The one-time adversarial run on job/touch-369 reproduced the undo/redo mismatch at seed 25608414 (tests/adversarial/editor.mjs, “editor paste, Unicode, and block actions”). After hostile paste, IME, and block actions, the history round-trip assertion failed: the actual editor text lost the separator before parentchildsibling and the space/initial f in first-marker. The round ran under heavy shared-host load. This is outside #369's UI scope; no editor code or test expectation was changed here.

The one-time adversarial run on `job/touch-369` reproduced the undo/redo mismatch at seed `25608414` (`tests/adversarial/editor.mjs`, “editor paste, Unicode, and block actions”). After hostile paste, IME, and block actions, the history round-trip assertion failed: the actual editor text lost the separator before `parentchildsibling` and the space/initial `f` in `first-marker`. The round ran under heavy shared-host load. This is outside #369's UI scope; no editor code or test expectation was changed here.
kayg closed this issue 2026-09-29 03:38:00 +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#314
No description provided.