Public: anyone can read this; the crew can change it.
Events: an explicit seq for replays, which VACUUM cannot renumber #948
Check · Review · Land · Live done — Landed and live in production.
Follow-up to #932 (#936), from its review. **Migration 69**, appended last.
shipped production is serving it deploy b2c98db
Sign in to join this conversation.
new above
offline
Follow-up to #932 (#936), from its review. Migration 69, appended last.
#936 ordered events and resumed replays by the table's rowid. The event table has no INTEGER PRIMARY KEY, so VACUUM (and a VACUUM INTO snapshot) may renumber those rowids. Now each event carries its own place:
event.seq, backfills it from the rowid, and indexes it: unique onseq, and on(repo_id, seq)for a repository's list.seqto the next number on every insert that does not give one: the app'sbus.append, another connection, and a migration's SQL alike. There is one writer at a time, so it is strictly increasing across every connection.afterEventand both lists'ORDER BYreadseq. Cursors are still the event's id, resolved on the server, as in #936.Tests:
test/event-order.test.ts. Three new cases fail without the change:seq;seqas it was.The five cases from #936 still hold.
🤖 Generated with Claude Code