Repository navigation
fix: keep a draft write out in the words watch until its answer is heard - #6164
Merged
Merged
Conversation
The words watch removed a draft write from the writes it counts as still out when the response's headers arrived, but recorded what the server holds only after reading the body. A close judged between the two found the words in neither and reported back-saved draft words as lost, which since #6124 failed both cases of test_a_back_gesture_never_throws_away_unsent_words at teardown. The write now settles after its answer is heard. No product behavior changes. Closes #6163
This was referenced Nov 16, 2026
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.
The words watch (
tests/words_watch.js) stopped counting a draft write as still out as soon as the/api/draftresponse's headers arrived, but recorded what the server holds only after it had read the response body. A close checked between those two moments found the words in neitherdraftsOutnordraftsHeld, sostored(words)was false and the watch reported back-saved draft words as lost. Back's close lands in exactly that gap, because closing the editor is what sends the write. This change makes the write settle after its answer is heard, so the words are always in one set or the other. Neither the runtime nor the server changes.Logging the watch during a run of
[draft]showed this order: the write's response arrives, then the close is checked withheld: []andout: {edit:d: {}}, and only then is the answer heard withrecord.text: "Unsent words.". #6124 introduced the gap when it replaced the watch's localStorage scan with tracking of/api/drafttraffic.Verification:
tests/browser/navigation/test_key_scopes.py::test_a_back_gesture_never_throws_away_unsent_wordserrored at teardown in both[draft]and[rewrite]with-n0onmain(1740bb536), and both cases pass after the change.tests/runtime/words-watch.test.mjs, the draft-related cases oftests/browser/test_render_words_watch.py, and the tab/close cases intests/browser/drafts/also pass.Closes #6163 — automated triage