fix: map 'timed out' race rejection to 504 instead of generic 500 - #80
fix: map 'timed out' race rejection to 504 instead of generic 500#80eprouveze wants to merge 1 commit into
Conversation
|
@eprouveze is attempting to deploy a commit to the sculpt Team on Vercel. A member of the Team first needs to authorize it. |
|
Correct fix, and correctly scoped — you spotted that Superseded by #100, which uses #100 also fixes the branch just below the one you touched: Closing in favour of #100. Thanks for the report and sorry it took a while to land. |
|
Closing as superseded by #100, now merged. See the review comment above for what carried over and what changed. |
What
The submit route's own 25s timeout race rejects with the message
"Database operation timed out", but the error mapping below only checks for the substrings"timeout"and"deadline"—"timed out"(with a space) matches neither. So when a large-history merge blows the 25s window, the client gets the generic catch-all 500 "Failed to submit data. Please check your cc.json file format..." instead of the intended 504 "Request timed out. Please try again or submit smaller batches of data."That message difference matters: the 500 sends users down a payload-format rabbit hole, while the 504 tells them the actual fix (smaller batches).
How I hit this
My account (
eprouveze) has a ~188-day history. Since the #43/#79 per-machine merge deploy,mergeWithExistingruns one sequentialdaily_breakdownsround-trip per incoming day, so a full-history re-submit merging into an existing ~180-day record can exceed the 25s race. Every attempt returned the generic 500 with a payload that field-diffs identical to my last accepted submission (June 10, pre-deploy) — I only found the real cause by reading this route's source. Splitting the same data into ≤60-day chunks submits fine.Notes
"timed out"to the existing substring check (plus a comment tying it to the race above).mergeWithExisting(e.g. a single upsert on(submission_id, date)) would remove the timeout for long-history users entirely.🤖 Generated with Claude Code
https://claude.ai/code/session_01CprMNM6BjWgqLGcmCjZVZJ