#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.
#26 put every card and column mutation behind
db.transaction(...).immediate()with abusy_timeout, which is right. Two writes insrc/db.tswere left outside it, and they are the two that decide who a board belongs to and whether it is usable at all.claimBoardreads the board, checksowner_id === null, thenUPDATE 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 seenull, both return"claimed", and the later write silently takes the board from the earlier one.createBoarddoesINSERT INTO boardand then three separatecreateColumncalls, 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.