Repository navigation
A restore records the trashed page row it was made against - #1026
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
… from it once its page has left
…dits made behind them, and not-found refusals that leave nothing offered
…t the record, it would not be drawn
…at leave nothing offered; seed 72992 shows a page edit made behind such a restore answered applied
…age away at once, before and after a reopen, and the recorded row does not draw it back
…of its recorded row and the page list's trash row; the model samples restores drawn from their record after a read is mirrored, counts only page adds behind them, counts a not-found refusal only when the page is not drawn; the set-aside test checks the restore stays set aside
…ot-found refusals that leave nothing drawn or offered, 1 page add behind such a restore in seed 72992
…ded row and the listed trash row
SunkenInTime
force-pushed
the
t3/store-restore-recorded-row
branch
from
November 30, 2026 14:43
955b2da to
e12ade9
Compare
This was referenced Nov 30, 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.
Part of the one-store cutover (#615). It fixes sweep seed 72992 from #847: my restore of a page was queued, then a page result came back saying the page was gone. The store dropped the page row, and the restore was drawn as nothing. The drawn strategy revision fell by one, so my next page add was made one revision low and the player was asked a false question when it went out.
The design
AuthoredRow.restoredRow). These are the same rowsRestoreNotTakenchecks. Its landed work keeps a copy, the same waymovedRowdoes for a move.restoringFromis the only reader. If the drawn rows hold any form of the page, it draws from them. If not, it draws from the later of the recorded row and the page list's trash row, byVersionorder (life, then revision; on a tie, the listed row). A row stored without the record falls back to the page list's trash, as on main. Each draw uses one source._leftWithItsRow,_knownRow, the judge,contentKnownandtrashOffereddon't change, and none of them reads the record. Nothing is added toShownor the cached rows, so no queue rule can take the record for server state (73570's cause). The record goes away with its queue row or landed work, so no exit rule is needed. A reopen draws the same as memory.Stored format
One new optional key,
restoredRow, onpending/rows (insideauthored) and onlanded/rows. It holds the trashed page row. There is no version bump, and the key isn'tmovedRow: that key's decoder rejects anything that isn't an item row, so an older build would hold the whole queue. A row without the key draws exactly as main does. Both directions are tested:cloud_restored_row_older_build_test.dartagainst 863ea63 in a separate worktree, and it passes there.Rollback: a build without the key ignores it on read. If that build rewrites the row, the key is dropped and main's behaviour comes back for that restore: it's drawn from the page list's trash, or not at all. Nothing is lost.
Two model changes
These bring the queue model in line with the store.
pagesLeftBy, the part of the 73242 fix that does this, nothing else from it). Seed 72992 shows it: without this change the branch still fails 72992 on op60 with main's text. 75620 fails the same way without it, on op31.Clientnow makes edits overrestoringFrom(visible), as_commitClouddoes, so a restore made from the page list's trash records its row in the model as it does in the store. No seed shows this change alone. With only this change reverted, queue seeds 1–200 and 72000–74000 fail exactly as the branch does (72928, 73483, 73591, 73913). In the default run it affects the 29 restores made from the page list's trash.Counters
Queue model, default run (200 seeds, 150 steps, both folding modes):
A restore counts as drawn from its record only when the same queue without records wouldn't draw it. The default 200 seeds never make a page edit while such a restore is drawn, so that counter's floor sits on seed 72992, which fails on main.
Store tests
Eight paths in
cloud_store_restore_recorded_row_test.dart(pluscloud_restored_row_older_build_test.dartfor path 7):NeedsUser: changed by someone else since the user saw it.['page-a'], page-b not drawn.Also: the queued restore draws from its record before and after a reopen, with its content not read (fails on main:
['page-a']), and this build writes exactly the row the older-build test reads.Sweep
Branch at fa18004 (same package code as this head; later commits change only counters, floors and the README). Queue 72000–74000 and 74201–76200 at 150 steps in both folding modes, and store 1–740 at 120. Main (863ea63, the same package code as ab5637d) was asked only about seeds that failed.
Known limits
ci: analyze test web library


Confidence Score: 5/5
The PR appears safe to merge once the selected CI checks pass.Summary
Restores now keep the trashed page row they were made against, so an arriving result cannot make a waiting restore disappear.
No actionable issues were found. The previous-review guard failed because the merge bases differ, so the supplied full PR changes were reviewed. Checks were limited to source and test inspection; tests were not run. Run the selected CI lanes before merging.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Restore committed] --> B[Save trashed page row with queued work] B --> C[Draw restore] C --> D{Drawn rows hold the page?} D -- Yes --> E[Use drawn rows] D -- No --> F[Use newer recorded or listed trash row] B --> G[Server accepts restore] G --> H[Carry recorded row into landed work] H --> C H --> I[Later result settles landed work]Reviews (6) · Last reviewed commit: "The README states the restore's draw as ..." · Reviewed by Greptile