Claude Opus 5.5 · Balanced
feat-2fa-backup-codes-cal-com
cal.com · TypeScript · M · 100–299 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 0 of 1
- Comments published
- 3
- Comments matching a bug
- 0
- Comments not matching
- 3
- Cost of this PR
- $0.729
Published comments (3)
Backup code consumption is not atomic, so one code can be reused concurrently — Two concurrent logins can both read the old `backupCodes`, match the same code, and each create a session. Use a conditional update on `id` plus the previous `backupCodes` value that rejects when no row changes, or a transaction with row locking.
Dismissing modal on backup-codes step skips onEnable and resetState — The user query is never invalidated, so the switch still shows 2FA disabled after the server enabled it, and reopening shows the stale backup-codes step. In `onOpenChange`, call `resetState` and `onEnable` when closing on `DisplayBackupCodes`, or block dismissal on that step.
Non-string backupCode crashes endpoint with 500 instead of IncorrectBackupCode — A JSON number or object in `req.body.backupCode` passes the truthiness check, so `.replaceAll` throws and the client gets an unhandled 500. Return `IncorrectBackupCode` unless `typeof req.body.backupCode === "string"` before normalizing it.
Gold bugs found (0)
None.