fix(browser): recognise an own commit's echo by signature, before the ack [full-e2e] - #1378
Merged
Conversation
… ack [full-e2e] Since #1377 the server echoes a commit to its author. `applyIncoming` deduped that echo by comparing the wire commit id with the cached `lastCommit`, which the ack stamps — and under load the echo lands first. It was then treated as a peer's push: imported (fine) and notified (not fine): the page re-rendered right as the user opened the next cell's tag picker, and develop's full e2e lost `tables › create and fill`. The drain now registers the signature in `appliedCommitSignatures` before the POST (the genesis too), and `applyIncoming` treats an id carrying a signature this client signed as its own: import silently, no notify, whatever the order.
pendingDirtyCount === 0 means the server has the edit; the OPFS write that mirrors it sits on a worker that the next navigation destroys, and a folder page loaded from OPFS then lacks the child that was just made. That gap is what made folder @smoke flap on the runner.
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.
Follow-up to #1377.
What
The server now echoes a commit to its author.
Store.applyIncomingrecognised that echo only by the cachedlastCommit, which the ack stamps; under load the echo arrives beforeCOMMIT_OK, so it was handled as a peer's push: imported (correct) and notified (a re-render mid-edit). Develop's first full run after #1377 losttables › create and fill @smokeon exactly that: the tag picker closed while the test was typing into it.How
drainOutboxSubjectadds the signature toresource.appliedCommitSignaturesbefore the POST (genesis included).applyIncomingtreats a commit id whose signature is in that set as its own: the bytes are imported (the server'slastCommitstamp must land), nothing is notified,'deduped'is returned. Works whichever of ack and echo lands first.Verification
@tomic/libvitest: 353 passed, including a new case for the echo-before-ack ordering.tables › create and fill,fast row entry,documentswebsockets + ephemeral cursor,quick edit,history page: 12/12.[full-e2e]in the title so this branch runs the whole suite.Full-e2e samples on this branch
Three
[full-e2e]runs. The final failed lists: run 1 — folder, sidebar subresource, localized-text column, fast row entry, dashboard block, Cmd+M, saved-drives; run 2 — Cmd+M, fast row entry, dashboard block, documents websockets, folder; run 3 (withwaitForSyncedflushing the ClientDb) — sidebar subresource, dashboard block, Cmd+M (fast row entry and Shift+Enter flaky, passed on retry). Develop itself failed 6 of the same family before #1377 and 2 after it. Every one of these passes 3/3 serially on a Mac against the same build; the residual set is the runner-load family already documented, not this change.