fix: bind queue candidates to their owner

This commit is contained in:
Josh Creek
2026-08-31 22:05:44 +01:00
parent b47c7dc3fa
commit 3b208ae860
3 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ func (q *Queue) Create(playerID, ticketID, idempotencyKey string, candidate Cand
}
return prior.ticket, nil
}
if idempotencyKey == "" || playerID == "" || ticketID == "" || candidate.TicketID != ticketID {
if idempotencyKey == "" || playerID == "" || ticketID == "" || candidate.TicketID != ticketID || candidate.PlayerID != playerID {
return QueueTicket{}, fmt.Errorf("%w: invalid queue create", ErrConflict)
}
if _, ok := q.byPlayer[playerID]; ok {