mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
9dd2e1b983
Days, todo items, packing items and bags, packing template categories and items, collections, collection labels and road-trip vias took their next position as MAX(...) + 1 in one statement and inserted in the next, with any other request free to run in between: two adds at once read the same MAX and landed on the same position (the road-trip test pinned exactly that duplicate). The read now sits in the transaction that inserts, and the transaction holds the connection, so the second add waits and takes the next position. A collection label's limit and name check move into the same transaction, so two labels of one name added at once end in one label and a 409. Each site gets a test that adds several rows at once and reads back one position each.