Public: anyone can read this; the crew can change it.
Events keep their order across processes: replays resume by the table's own sequence #940
Events are now ordered, and every replay resumes, by the event table's rowid instead of the id. The id stays the public name and the cursor stays an id. The new test passes.
stopped closed without shipping deploy 6cf2b9d
Sign in to join this conversation.
new above
offline
Events are now ordered, and every replay resumes, by the event table's rowid instead of the id. The id stays the public name and the cursor stays an id. The new test passes. I couldn't run the whole suite here: the sandbox blocks the listening sockets that
sse.test.tsandorigins-sync.test.tsneed, so those failed withEPERM. The other tests I ran pass,scale.test.tsonly with a longer timeout. The first fullbun testtimed out here, so it never finished.listEventsandlistEventsVisibleToinsrc/core/events.tssort newest first by rowid.afterIdmeans "written after the event with this id". An id that names no event, say because its repository was deleted, resumes after the last event whose id sorts at or below it.sseStreaminsrc/http/sse.tsnow replays fromLast-Event-IDorsincebefore going live, like the forge-wide stream. It replays at most the 200 newest events after the cursor, as the forge-wide one does.(repo_id, id)and(kind, id)indexes oneventwith single-column ones. A single-column index carries the rowid, so the repo and kind reads stay indexed in the new order.test/event-order.test.tshas one connection write an event, then a second connection write a same-millisecond event with a smaller id. Lists,afterIdreplay, and both streams resumed after the first event all return the second one. I didn't run it against the old code, but the old id comparison would have skipped that event.I left out the 200-event replay cap, which keeps the newest 200 events after the cursor. A client that is more than 200 events behind skips the oldest, as before. Fixing that is a separate change.
To try it:
bun test test/event-order.test.ts.test/scale.test.tsalso touches this code and needs a longer timeout on a loaded machine (--timeout 30000).🤖 Generated with Claude Code
Closes #932