fix: metadata endpoints 404 on real keys in production#158
Merged
Conversation
… router mismatch)
The deployed worker 404'd on GET/PATCH /v1/:workspace/files/:key{.+}/metadata
for any real (slash-containing) key: Hono's production router doesn't match a
{.+} param followed by a static suffix across slashes, even though the local
vitest harness (which matches raw slashes) passed. Percent-encoding the slashes
into one path segment returned 200, confirming a router mismatch rather than a
storage bug.
Move metadata onto the key-at-tail routes already proven in prod: GET
/v1/:workspace/files/:key{.+}?metadata=1 and a bare PATCH on the same route
(PATCH has no other meaning there). Update the CLI client, the gh.* backfill
script, and route/client tests to the new shapes.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-auth | e13fedf | Commit Preview URL Branch Preview URL |
Jul 14 2026, 01:09 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-api | e13fedf | Commit Preview URL Branch Preview URL |
Jul 14 2026, 01:09 AM |
This was referenced Jul 14, 2026
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.
In plain terms
The new per-file metadata endpoints worked in tests but 404 in production for every real object key. The deployed router doesn't match
/:key{.+}/metadataacross slashes (percent-encoding the slashes returns 200, which pinpointed the router as the culprit). This blocked the gh backfill.What it does
GET /v1/:ws/files/:key?metadata=1and writes toPATCH /v1/:ws/files/:key— the key-at-tail shape every other file route already uses and that provably matches in production.Test plan
GET …?metadata=1and PATCH against prod, then run the gh backfill