Skip to content

Commit

Permalink
tlv2 idempotency: check both credential and request id
Browse files Browse the repository at this point in the history
should make the query a little more efficient
  • Loading branch information
evq authored Aug 21, 2024
1 parent fc0db24 commit 7f83079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/skus/storage/repository/tlv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r *TLV2) GetCredSubmissionReport(ctx context.Context, dbi sqlx.QueryerCont
}

const q = `SELECT EXISTS(
SELECT 1 FROM time_limited_v2_order_creds WHERE blinded_creds->>0 = $2
SELECT 1 FROM time_limited_v2_order_creds WHERE blinded_creds->>0 = $2 AND request_id = $1
) AS submitted, EXISTS(
SELECT 1 FROM time_limited_v2_order_creds WHERE blinded_creds->>0 != $2 AND request_id = $1
) AS req_id_mismatch`
Expand Down

0 comments on commit 7f83079

Please sign in to comment.