Skip to content

Commit 6dc20ec

Browse files
committed
fix: handle duplicate tournament roster insert on invite accept
Add on_conflict clause to the tournament_team_roster insert mutation in acceptTournamentTeamInvite. Without this, a player accepting an invite twice (e.g. double-click or retry after timeout) triggers a uniqueness violation on tournament_roster_pkey.
1 parent 07c4d21 commit 6dc20ec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/invites/invites.controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ export class InvitesController {
256256
tournament_team_invites_by_pk.tournament_team_id,
257257
player_steam_id: user.steam_id,
258258
},
259+
on_conflict: {
260+
constraint: "tournament_roster_pkey",
261+
update_columns: ["role"],
262+
},
259263
},
260264
__typename: true,
261265
},

0 commit comments

Comments
 (0)