Merged
Stamp per-tab tab_seq on browser writes and pass it to saver#387
Conversation
Establish the (laptop_id, tab_id, tab_seq) idempotency key end-to-end so saver can recognise a redelivered or re-fired write and dedup it. This is the bridge step before the spooler: landing the key now soaks the browser stamping in production and de-risks saver's contract change ahead of the durable, ordered forwarding the spooler will add. The browser owns tab_seq: a monotonic per-tab counter (cd.kata.nextTabSeq) incremented once per event-write POST - one value per browser action, even when a [test] commits two saver events. All four write paths stamp it (the ITE helper, run_tests, auto_revert, checkout). web forwards it through app.rb into saver_service's nine write methods as a required argument. Tests pass a required tab_seq too: a monotonic next_tab_seq helper gives a distinct value per write, since saver only dedups on a truthy tab_seq and a constant would collapse two same-laptop/same-colour writes. Adds a forwarding test mirroring the laptop_id one.
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.
Establish the (laptop_id, tab_id, tab_seq) idempotency key end-to-end so
saver can recognise a redelivered or re-fired write and dedup it. This is
the bridge step before the spooler: landing the key now soaks the browser
stamping in production and de-risks saver's contract change ahead of the
durable, ordered forwarding the spooler will add.
The browser owns tab_seq: a monotonic per-tab counter (cd.kata.nextTabSeq)
incremented once per event-write POST - one value per browser action, even
when a [test] commits two saver events. All four write paths stamp it (the
ITE helper, run_tests, auto_revert, checkout). web forwards it through
app.rb into saver_service's nine write methods as a required argument.
Tests pass a required tab_seq too: a monotonic next_tab_seq helper gives a
distinct value per write, since saver only dedups on a truthy tab_seq and a
constant would collapse two same-laptop/same-colour writes. Adds a
forwarding test mirroring the laptop_id one.