Repository navigation
test: wait for the mirrored reply draft instead of saveDraft's return value - #6189
Merged
Merged
Conversation
… value #6124 moved drafts to the page's server, so saveDraft no longer reports a durable localStorage write: it returns nothing and the words reach the other tab through the server's drafts news. The seat-mirrored journeys asserted that return value, so they failed at once. The journey now calls saveDraft and waits for the words to arrive in the first tab, which it already did. The composing case also wrote from a tab that had not yet heard the first tab's composing words. Under #6124's compare-and-set, the stale write gives way to the first one, so "First line" never arrived. The second tab now waits until it has heard "Composing" before writing over it, so the journey still checks that mirrored words land in a composing field without moving it. No behavior changes; saveDraft's documented contract (module-input.md) never promised a return value. Closes #6176
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.
Two
seat-mirroredcases oftest_native_reply_edits_after_semantic_paint_keep_the_first_linehave failed on main since #6124 moved drafts to the page's server. This changes only the test; Leaf's behavior is unchanged.saveDraft's return value. Before Keep drafts on the page's server, so they follow the user between tabs and devices #6124 that value said the localStorage write was durable. NowsaveDraftreturns nothing, and the words reach the other tab through the server's drafts news. The documented contract inskills/leaf/references/module-input.mdnever promised a return value, and no runtime caller reads one. The journey now callssaveDraftand relies on theexpect(editor).to_have_js_property("value", "First line")that follows, which waits for the words to arrive.Composing). Under Keep drafts on the page's server, so they follow the user between tabs and devices #6124's compare-and-set, the earlier write wins and the stale write gives way, which matches the rule Keep drafts on the page's server, so they follow the user between tabs and devices #6124's description sets out. SoFirst linenever arrived. The second tab now waits forloadDraftto showComposingbefore it writes. The journey still checks what it was written to check: mirrored words land in a composing field without moving the field or firing edit events.Verification: on
f1b367375(main), running the test function by node id gives 2 failed, 6 passed, with the twoseat-mirroredcases failing. With this change all 8 pass.Closes #6176 — automated triage