Multi-step writes run without transactions (partial campaign/character on failure) #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Medium (data integrity)
A transaction helper exists but is unused:
Affected flows:
Suggested fix
Wrap create/update flows in `withTransaction` (needs the query helper to accept an optional client).
✅ Fixed:
withTransaction(fn)using AsyncLocalStorage — anyquery()issued inside joins the same Postgres transaction automatically (zero call-site churn)createCampaign(INSERT + players + events + systems + routes + factions + contacts + sessions),updateCampaignchild replacement block,createCharacter(row + skills + talents + augments + kit)✅ Fixed (commit
05b5453) — newwithTransaction()helper using AsyncLocalStorage; anyquery()inside automatically joins the transaction (zero call-site changes). Wrapped createCampaign (all 9 writes), updateCampaign child replacement, createCharacter (row + skills + talents + augments + kit). SQLite gets BEGIN/COMMIT/ROLLBACK too.