Skip to content

Test a held undo against a real copy that is catching up - #176

Merged
aicayzer merged 1 commit into
mainfrom
test/held-undo-live
Oct 26, 2026
Merged

aicayzer merged 1 commit into
mainfrom
test/held-undo-live

Conversation

@aicayzer

Copy link
Copy Markdown
Contributor

Adds two live tests, run by the Live test plan against a test instance, for the held undo from #173. Until now only unit tests, which fake the package's refusal, covered it.

What the tests do

Moving a child to another parent moves the source of its edge. The server answers by expiring the copy, so the copy hydrates again, and the package refuses an edge write until it is whole. The tests hold that hydration back with a wrapper around the real MarfaRefresh (GatedRefresh), so Undo is always pressed inside the window and the refusal is always the real package's. Nothing is faked and nothing sleeps.

  • anUndoPressedWhileTheCopyCatchesUpIsHeldAndThenMadeOnce: Undo is pressed while the copy is catching up. The test checks that the engine holds it (so the package did refuse it), that nothing is told to the person and the server still has the child under the new parent. Once the hydration is released, the server has the child back under the first parent on the same edge, one version later, and nothing is held or told.
  • anUndoHeldWhileAnotherConnectionChangesTheItemIsNotMade: while the Undo is held, a second copy moves the same edge to a third parent and rewrites the child's text. After the release the Undo is not made, the person is told (MarfaEngine.heldChanged), the Undo is back on the stack, and the edge and the newer text are as the second copy left them, on the server and in the library.

The server's edges are read over HTTP (GET /items/{id}/backrefs), not through a copy.

Limit

An item edit is not covered: the package queues an edit to a row it holds at once, so it is not refused during a catch-up, and the public pieces cannot make it refuse one.

Tests only. Run against the demo test instance together with MarfaLibraryLiveTests: both pass.

@aicayzer
aicayzer merged commit fab72fc into main Oct 26, 2026
4 checks passed
@aicayzer
aicayzer deleted the test/held-undo-live branch October 26, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant