Repository navigation
fix(ui): call useQueue's beforeProcess before every task, so autosave keeps edits made during a queued save - #18350
Closed
adrian-baker wants to merge 1 commit into
Closed
adrian-baker wants to merge 1 commit into
adrian-baker wants to merge 1 commit into
Conversation
afterProcess already runs after every task, so a task queued behind another ran after afterProcess and without a beforeProcess of its own. Autosave uses the pair to set the form's background processing flag, so an edit made during a queued autosave wasn't recorded as modified while processing, and the autosave for that edit was skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
adrian-baker
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
September 28, 2026 04:54
Member
|
See my comment here: #18349 (comment) |
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.
What?
useQueuenow callsbeforeProcessbefore each task it runs, instead of once before its loop.afterProcessalready runs after each task, so the two now pair up for every task. This is the3.xcounterpart of #18349, with the same change.Why?
Autosave uses the two callbacks to set the form's background processing flag on and off. When a second autosave was queued behind the first, it ran after
afterProcesshad turned the flag off, and nothing turned it back on. An edit made during that save then wasn't recorded as "modified while processing", the save's response resetmodifiedtofalse, and the autosave for that edit found nothing to save. The editor's last edit was lost, although the field showed it. Fixes #18348, which has the full sequence.How?
The
beforeProcesscheck moves to the top of thewhileloop. Returningfalsestill stops processing and leaves the queue as it was, as it did before the loop. The doc comment onbeforeProcesssays it's called before each function.3.xhas no browser test project for a hook test, so this PR has no spec. #18349 addsuseQueue.spec.tsxonmain, where the first test fails without the change. On 3.90.2, a Playwright run that holds each autosave request lost the last edit on every run without the change, and kept it on every run with it.🤖 Generated with Claude Code