Repository navigation
Return 422 for unresolved Devpost links so Cloudflare keeps the body - #33
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Uploading on the dashboard showed
{"ok": false, "error": "Could not upload the projects. Try again.", "code": "HTTP_502"}.MDredd itself answered correctly:
502withDEVPOST_UNRESOLVEDand the failed rows ("Test" needs a Devpost login, "Test 2" not found). Butmdredd.mhacks.orgis proxied through Cloudflare (server: cloudflare; the wildcard record hasproxied = 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_UNRESOLVEDis now 422. That status passes through Cloudflare, and it fits better: the problem is the links in the uploaded CSV. The dashboard keys offdetail.code, not the status, so it needs no change. The now-unused 502 entry in the OpenAPI error docs is removed.Testing
422with the sameDEVPOST_UNRESOLVEDbody and failure list.app/api/errors.py.Also worth knowing
Cloudflare cuts off any request at 100 seconds with a
524, whatever the load balancer'sidle_timeoutis. 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, raiseMDREDD_DEVPOST_CONCURRENCY.🤖 Generated with Claude Code