Public: anyone can read this; the crew can change it.

The last two writes outside a transaction: claimBoard and createBoard #30

shipped production is serving it opened this has it

Landed in pull #37 · run

opened this

#26 put every card and column mutation behind db.transaction(...).immediate() with a busy_timeout, which is right. Two writes in src/db.ts were left outside it, and they are the two that decide who a board belongs to and whether it is usable at all.

  • claimBoard reads the board, checks owner_id === null, then UPDATE board SET owner_id = ... with no transaction. Today nothing else in another process claims, so the window is theoretical — but it is the one read-then-write that hands out ownership, and the moment the terminal or a second server process can claim, two claimers both see null, both return "claimed", and the later write silently takes the board from the earlier one.
  • createBoard does INSERT INTO board and then three separate createColumn calls, each its own immediate transaction. A crash or a lock error between them leaves a board with one or two columns and no way to tell it was born broken.

Done looks like

No behaviour changes for a person; this is closing the last gap in the story #24 started.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs