Skip to content

Return 422 for unresolved Devpost links so Cloudflare keeps the body - #33

Merged
pradhamk merged 1 commit into
mainfrom
devpost-unresolved-422
Oct 3, 2026
Merged

pradhamk merged 1 commit into
mainfrom
devpost-unresolved-422

Conversation

@pradhamk

@pradhamk pradhamk commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

Uploading on the dashboard showed {"ok": false, "error": "Could not upload the projects. Try again.", "code": "HTTP_502"}.

MDredd itself answered correctly: 502 with DEVPOST_UNRESOLVED and the failed rows ("Test" needs a Devpost login, "Test 2" not found). But mdredd.mhacks.org is proxied through Cloudflare (server: cloudflare; the wildcard record has proxied = true), and Cloudflare replaces a 502 response's body with its own error page. The dashboard got no JSON, so it couldn't show which rows failed.

DEVPOST_UNRESOLVED is now 422. That status passes through Cloudflare, and it fits better: the problem is the links in the uploaded CSV. The dashboard keys off detail.code, not the status, so it needs no change. The now-unused 502 entry in the OpenAPI error docs is removed.

Testing

  • Built the image and uploaded the same CSV with real Devpost resolution: it now returns 422 with the same DEVPOST_UNRESOLVED body and failure list.
  • basedpyright passes on app/api/errors.py.

Also worth knowing

Cloudflare cuts off any request at 100 seconds with a 524, whatever the load balancer's idle_timeout is. At the default 4 lookups at a time, resolving ~300 projects takes about 25–40 seconds, so it should fit. If Devpost is slow on the day, raise MDREDD_DEVPOST_CONCURRENCY.

🤖 Generated with Claude Code

mdredd.mhacks.org is proxied through Cloudflare, which replaces a 502
response's body with its own error page. The dashboard then saw a bare
HTTP_502 instead of DEVPOST_UNRESOLVED and the list of failed rows. The
links in the uploaded CSV are the problem, so 422 also fits better.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pradhamk
pradhamk merged commit 6929dbe into main Oct 3, 2026
1 check passed
@pradhamk
pradhamk deleted the devpost-unresolved-422 branch October 3, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant