mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 12:22:04 +00:00
fix(multiplayer): promote accepted matches atomically
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user