fix(multiplayer): promote accepted matches atomically

This commit is contained in:
Josh Creek
2026-09-03 00:13:18 +01:00
parent eaf7ea8748
commit 1976c6eac6
4 changed files with 112 additions and 36 deletions
+3
View File
@@ -398,6 +398,9 @@ func RespondToProposal(ctx context.Context, db *sql.DB, playerID, proposalID, id
if targetState != state {
if targetState == string(domain.Accepted) {
_, err = tx.ExecContext(ctx, ProposalAcceptSQL, proposalID)
if err == nil {
err = promotePlannedAcceptedProposalTx(ctx, tx, proposalID, domain.Playlist(playlist))
}
} else {
_, err = tx.ExecContext(ctx, ProposalDeclineSQL, proposalID)
if err != nil {