Repository navigation
Put mine back and Send mine for held conflicts, through the store's Keep mine - #1021
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…ith the version as drawn; Go to that page otherwise; every store answer has its words
…he lineup pair drags the origin addLineup makes
…h no driver step reaches
…he item, per held change; the wait for a read ends on the read; Send mine for a change on a page that came back
…read instead of writing; the page-back reason says it can be sent; a moved-first pair that ends with Send mine
…counts a list without the page as a read
…the popover offers that button; elsewhere it keeps #1020's words
c31c3f0 to
366669e
Compare
… the popover draws one offer decided next to the rows; a held row has one kind and Keep's last answer is named as one; a keep that throws clears the busy state with the doubt words
…never a conflict is kept; after a gone answer only the discard, from the rows as drawn
…ng only the version first shown per change; gone covers every kind it can send; each reason's words follow its own kind; Go to that page whenever a held change is off screen
…nge; a press checks the same; the applied-snapshot provider is gone
In
ownmode, a held change can now be won as well as dropped. Put mine back sends the player's change over the teammate's. Send mine sends a change that was held before it went out, or one on a page that was deleted and came back. Follows #1020 (merged), which added Discard mine, Don't send and the one-write Restore.Part of #615, on the store's Keep mine (#1015).
What changes
Put mine back and Send mine go through the store's Keep mine:
UserKeptMine(opId, replacement, authored: AuthoredNoRow(), shownVersion:);renamed, now exported by the package) and nothing else: the store drops the merge base and rebases to the row it holds;shownVersionis the server version of the row in the drawing the popover opened with (serverVersionAsDrawnoverstoreReadOfof the latest drawn snapshot).The popover is a picture of the rows at open. It closes as soon as the rows as drawn change: a page switch, a later edit of the item, a teammate's change arriving, a page restored, or the read after "not yet". The chip stays on attention, and opening it again gives a new picture with new versions. A press checks the same thing and does nothing if the rows are no longer the ones it opened with.
One offer decides what the popover shows (
keepOfferOf, next to the rows): which held changes can be kept, the button, whether it waits, where Go to that page goes, and which sentences show. The widget only draws it.When Put mine back is offered. Only for a change on the page on screen, and only when nothing of the player's is drawn over that item. If they changed the same item again after the held change, the popover says "You changed it again after this. Discard mine gives up both; then make your change again." and offers Discard mine only. Putting the first change back would replace a version the player never saw. Nothing is sent after a put-back by itself.
A page that came back. A change the server refused because its page was deleted is held under "this page came back; your change waits to be sent" (from #1020). Here it also gets Send mine. The press writes nothing until the store has read the page since the refusal; until then it answers "not yet", like any other keep.
Every store answer has its words (
KeepOutcome):The words follow the buttons. For each reason, the body that offers to put a change back or send it ("Put yours back to replace theirs, or discard it.", "Send yours, or don't send it…", "…until you send them or discard them") shows only when a change of that kind is offered. Otherwise, for a change the player changed again or one on another page, and in the leave-the-editor guard, it keeps #1020's words ("…yours is kept here until you discard it.").
The label. Put mine back whenever a kept change replaces a teammate's version on the page; Send mine only when every kept change is unsent or on a page that came back.
After the store answers gone, only the discard is offered until the popover is reopened.
Only on the page on screen. Whenever a held change is on another page, the popover says so and offers Go to that page (the first such change in queue order), so the player chooses with both versions in front of them.
Ground truth
Linux driver builds on the
storerunspreview, owner jules and teammate mika,--library-store store --cloud-store own. Every pair is CLEAN on both sides, each chip state checked against the server. All nine ran on main at 6a8a92b. On main at 881b72c, which brought #1026's restore drawing, the pairs that restore a page (restore, moved-first, moved-send) ran again, and so did keep and follow, which check the body above. On this head, where the popover became a picture of the rows at open, keep, follow and moved-send ran again, all CLEAN; the three pictures above are from those runs.store-keep-*: the popover says "Put yours back to replace theirs, or discard it.", and Put mine back moves a1 back to the owner's position on both sides, synced.store-keep-again-*: the teammate moves a1 again while the popover is open. Put mine back writes nothing, the sentence appears, the page shows the newer position, and Discard mine ends on it.store-keep-follow-*: the owner moves the held a1 again. The popover says "You changed it again after this…" and "…kept here until you discard it.", never "Put yours back"; Put mine back is not offered, and Discard mine ends synced on the teammate's position.store-unseen-send-*: the changed-unseen rename, ended with Send mine. The owner's name is on both sides.store-rename-held-*: a page rename held behind the teammate's shows the teammate's name, then Put mine back sends the owner's.store-map-keep-*: the map picked while the teammate picked Lotus is held, and the page shows Lotus. Put mine back gives Haven on both sides.store-deleted-page-moved-send-*: after Restore, the teammate's held move on the page that came back offers Send mine, which sends it over the owner's later move; both sides end on the teammate's position.With #1025 the store itself answers "not yet" for a keep on a page not read since the refusal, without announcing a change; this PR's own check (nothing written until the store has read the page since the refusal) stays, as the app saying what it knows.
Tests (880 across the store, keep, offer, chip, guard and session files). The offer table covers each held kind, mixed kinds across pages, both labels and each last answer; a second table shows the popover closing when the rows change (page switch, later edit, a teammate's change or the read after not yet, a page restored). Widget tests: the button and its press; the popover closing on a page switch while open; a press after the rows changed keeping nothing. Store tests: a keep answered changed again, then kept from the reopened popover; the overwrite repro (Put mine back offered over a version the player never saw, which fails on the earlier rule at the item's position), "not yet" ends on the read and a press after it lands, gone and live in one set, and Send for a page-back change before the page is read writes nothing and answers not yet (fails on the earlier code with
KeepChangedAgainand a store write).Known limits
For a moment the popover can be ahead of the canvas. The version is the one the store had drawn when the popover opened; the canvas applies that drawing a moment later (a microtask and one local store read), so for that moment the popover can name a newer version than the canvas shows. Any later change to the rows closes the popover.
Gone is decided twice. The popover hides Put mine back / Send mine for a held change whose item the app's gone set marks gone (a deleted row, or a page in the trash), for every kind it can send. The store's Keep mine has its own rule. It can still answer gone where the app did not mark it: a merged patch whose row is simply absent. And the app can mark gone a row on a trashed page the store would still accept. A press is safe either way, because the store decides and writes nothing; after a gone answer only the discard is offered. The real fix, drawing the offer from the store's own answer, is #1028.
Not covered here
Parked for Dara
Marked "Draft for Dara", with Japanese and Chinese drafts:
ci: analyze test web library