Bug: api.js retries 409 Conflict responses (duplicate lead submissions) #126
Labels
No Label
P0 Critical
P1 High
P2 Medium
P3 Low
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
performance
phase-7
phase-8
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#126
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
api.js retryFetch logic retries on 429 (rate limit) and 5xx errors, but does NOT explicitly exclude 409 Conflict from retry.
When the UNIQUE constraint on leads.email is eventually added (see #120), a duplicate email will return 409. The current retry logic treats 409 as a generic 4xx error and does NOT retry it (because it only retries 5xx and 429). So this is actually fine for now.
However, the 409 handler on the client side (Contact.jsx) does NOT exist. When a duplicate email is submitted, the user sees a generic error toast from api.js: "API error: Conflict" — not the friendly "A lead with this email already exists" message from the server.
The server returns
{ error: 'Duplicate lead', message: 'A lead with this email already exists' }but the client error handler only readserrorData.error, showing just "Duplicate lead" — not the more helpful message.Fix
Add 409 Conflict handling in Contact.jsx:
Files
Severity
Low — currently academic since #120 means duplicates are allowed. But once #120 is fixed, users need proper 409 messaging.