Repository navigation
Test a held undo against a real copy that is catching up - #176
Merged
Merged
Conversation
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.
Adds two
livetests, run by theLivetest 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
demotest instance together withMarfaLibraryLiveTests: both pass.