[Bug]: Partial cloud replay guard consume leaves half a proof pair#27863

openedOct 30, 2026bySsamkelly880

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Call consumeCloudReplayGuards with a jti/nonce pair where one secrets.create succeeds and the other hits AlreadyExists (concurrent or previously partial consume).

Expected behavior

The call reports a replay conflict and does not leave newly created guards behind.

Actual behavior

Parallel creates can succeed for one name and conflict on the other. The function returns false while the successful create remains in the secret store, poisoning later attempts with that proof.

Impact

A race or partial failure can permanently burn one half of a proof pair and reject a still-valid first use.

Fix

https://github.com/pingdotgg/t3code/pull/27864