Skip to content

fix(browser): recognise an own commit's echo by signature, before the ack [full-e2e] - #1378

Merged
joepio merged 3 commits into
developfrom
fix/echo-dedup-by-signature
Sep 6, 2026
Merged

fix(browser): recognise an own commit's echo by signature, before the ack [full-e2e]#1378
joepio merged 3 commits into
developfrom
fix/echo-dedup-by-signature

Conversation

@joepio

@joepio joepio commented Sep 6, 2026

Copy link
Copy Markdown
Member

Follow-up to #1377.

What

The server now echoes a commit to its author. Store.applyIncoming recognised that echo only by the cached lastCommit, which the ack stamps; under load the echo arrives before COMMIT_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 lost tables › create and fill @smoke on exactly that: the tag picker closed while the test was typing into it.

How

  • drainOutboxSubject adds the signature to resource.appliedCommitSignatures before the POST (genesis included).
  • applyIncoming treats a commit id whose signature is in that set as its own: the bytes are imported (the server's lastCommit stamp must land), nothing is notified, 'deduped' is returned. Works whichever of ack and echo lands first.

Verification

  • @tomic/lib vitest: 353 passed, including a new case for the echo-before-ack ordering.
  • Locally, serial ×2: tables › create and fill, fast row entry, documents websockets + 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 (with waitForSynced flushing 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.

… 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.
@joepio
joepio merged commit abba496 into develop Sep 6, 2026
4 of 7 checks passed
@joepio
joepio deleted the fix/echo-dedup-by-signature branch September 6, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant