Repository navigation
fix: close what the review of idempotency, snapshots and personal data found - #220
Merged
Merged
Conversation
…a found - createWorker no longer forgets anyone over HTTP: an irreversible operation has no place on an endpoint without authentication; apps call `forget` through `connect` behind their own. - The React Router host derives each command's key from the Idempotency-Key header and the command's name, so an action that dispatches two commands no longer conflicts on the second. - An idempotency key now also names the dispatch's delay, and fingerprints tell maps, sets and bigints apart instead of collapsing them or throwing. - A person whose fields were read in the clear needs no key for a snapshot or a remembered rejection to be written, so such streams are snapshotted again. - A snapshot never replaces a newer one of the same fingerprint. - PostgreSQL indexes `persons` so forgetting a person finds their rows without a full scan. - The personal-data guide says what forget cannot reach: scheduled payloads, dead letters, logs.
… may quote personal data
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.
A review of #212, #211, #213 and #219 together, before they ship in 0.3.0.
createWorkerno longer answersPOST /forget/<personId>: it has no authentication, and every Worker built on it, the Deploy to Cloudflare template included, would let anyone forget anyone for good. Apps callforgetthroughconnectbehind their own authentication; the docs say so.idempotencyKeyFor(header, commandName)instead of the raw header, so an action that dispatches two commands no longer conflicts on the second after the first committed.delay(a scheduled command and an immediate one never share a key), and maps, sets and bigints are told apart by what they hold instead of collapsing to{}or throwing.nullfingerprint needs no key for a snapshot or a remembered rejection to be written; before, a stream with a marked field stored in the clear was never snapshotted again, silently.putolder than the stored snapshot of the same fingerprint is ignored, in every adapter.persons(GIN,jsonb_path_ops) on snapshots and idempotency keys, soforgetfinds its rows without a full scan.forgetcannot reach (scheduled payloads, dead letters, logs), the delay in the conflict rules, and a link from idempotent commands to delivery guarantees. The three pending changesets describe the result.pnpm checkpasses (PostgreSQL included). Stryker on the files touched: 100 % onfingerprint.ts,held-keys.ts(both), the SQLite and memory stores andidempotency-key.ts; the survivors left inpipeline.ts,schema.ts,snapshot-store.ts(PostgreSQL) andworker.tsare on lines this PR does not change.