Repository navigation
Keep mine waits for a read before saying an item is gone, and a record that changes nothing announces nothing - #1025
Merged
Merged
Conversation
… naming no row (page deleted, not found, no life) with no row held answers not yet until its page, or a list showing the page gone, is read since the refusal; a record announces StrategyRefreshed only when its queue, its decided rows or its summary changed, so a refused keep no longer wakes a listener that asks again
|
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 34 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. |
…o read since it: Keep mine stays not yet until a read arrives after the refusal
…oth pages it names are: Keep mine on it no longer waits with no read to end the wait
SunkenInTime
added a commit
that referenced
this pull request
Nov 30, 2026
…counts a list without the page as a read
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 faults in Keep mine, merged with #1015 and found while tracing a freeze.
What the player saw
1. "This item is gone" before the page had been read. A teammate deleted a page while my edit to an item on it was in flight, so the server refused my edit as page deleted. The teammate restored the page. If I pressed Keep mine before the app had read the restored page, the store answered that the item was gone. It wasn't gone; the store just hadn't looked yet. The "not yet" check in
_keptOverBaseonly ran when the refusal named a server row. A page-deleted refusal names none, so it went straight to_keepRefusedOver. That saw a merge with no row to merge over and answeredRowGone.Now a keep with no row to merge over answers
RowNotReadYetuntil the page has been read since the refusal (readSinceRefusal, the same check the gone answer already used). Once it is read, the real answer comes through.readSinceRefusalalso counts a page list read this session that shows the page in the trash or purged. Without that, an item on a purged page would wait forever, because nothing reads a purged page again.Every refusal kind that names no server row, and what Keep mine answers now:
PAGE_DELETEDConflictedAtCommit)2. A refused keep announced a change, and the app froze. Every
recordcall sentStrategyRefreshedafter saving, even when nothing in it applied. The sender wakes on everyStrategyRefreshed. Each refused keep announced a change, which woke the waiting listener, which asked again, which was refused and announced again: 166,000 turns.Now
recordannounces when its queue changed, when rows were decided, or when the summary differs from the one already listed. A record that changes none of these writes nothing and announces nothing.The summary rule is there on purpose. The sync tally depends on the clock as well as the queue. The sender's timed look,
record(account, id, []), can cross a deadline with the queue untouched: for example, an undo waiting for its row needs the player once its delete's resend window closes. The new summary is written, and the sync chip only learns of it from this announcement. A gate on the queue alone would hide that; one test guards it.Who listens to
StrategyRefreshedand the store's changesEvery listener in
lib/and the package (the package has none of its own):lib/strategy/store_save_facts.dart, the sync chip: readssummary.syncfrom the event. A changed summary is always announced.lib/providers/collab/cloud_sync_status_provider.dart, the account's work list: rebuilds from the library list's summaries on any change. Same reason.lib/providers/collab/store_draw_source.dart: redraws the open strategy from the store. Anything that changes the drawing changes the queue (or decides rows), and that is always announced.lib/library_store/store_pictures.dart: watches for any change during one scan. A record that changes nothing leaves the scan valid.lib/library_store/cloud_sender.dart: maps the event towake(). This is the listener that looped; a refused keep no longer wakes it.lib/library_store/library_store_open.dart: uses onlyonDone.Tests
New, in
test/cloud_page_deleted_refusal_test.dart. On main 863ea63:Expected: RowNotReadYet, gotRowGone. After the read, the keep goes ahead.Expected: RowNotReadYet.RowNotReadYetuntil a list arrives after the refusal, then gone. The list read is held to the same since-the-refusal measure as the page read (listCurrentFor). With that check removed, this test fails withActual: RowGone, and it is the only test that does.Expected: emptyfor the announcements. Main already wrote nothing; the harm was the announcement alone.StrategyRefreshedcarrying the returned summary. Passes on main and here.changedUnseenit counts. Passes on main and here, and fails with a queue-only gate.Checks
_recordOnis what the store model calls. Queue 72000–74000 and 74201–76200 at 150 steps, both folding modes; store 1–740 at 120 steps.dart analyze --fatal-infosin the package: no issues.node tool/comments.mjs check: nothing above the baseline. No app file changed.ci: analyze test web library


Confidence Score: 5/5
The PR appears safe to merge; the previous move-related wait is fixed and no new actionable issues were found.Summary
Keep mine now waits for fresh reads of both pages when an item was being moved between pages.
Reviews (2) · Last reviewed commit: "A refused move to another page reads as ..." · Reviewed by Greptile