fix: resolve latest.json manifest via /releases/latest (#2225) - #356
fix: resolve latest.json manifest via /releases/latest (#2225)#356DTTerastar wants to merge 1 commit into
Conversation
The manifest handler fetched GitHub's /releases/tags/${tag}, but 'latest'
is not a real Git tag — GitHub returns 404, propagated as
{"error":"Release not found"} to the web installer, surfacing as
"Failed to download manifest" (#2225).
Fix: when tag === 'latest', use /releases/latest (the endpoint GitHub
provides for resolving newest non-prerelease), matching what the sibling
/latest/download/:filename route already does. Binary part paths now use
rel.tag_name (the resolved real tag, e.g. v4.0.6) instead of the literal
${tag}, so 'latest' manifests produce working download/v4.0.6/*.bin URLs
rather than nonexistent download/latest/*.bin paths.
wrangler.toml: add compatibility_date (was missing; local dev defaulted
to today's date which exceeds the bundled workerd).
Verified locally: wrangler pages dev + manual probe of
/releases/latest.json?flavor=esp32 returns 200 with correct builds and
binary paths pointing at the resolved v4.0.6 tag.
Refs: #2225.
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying espresense with
|
| Latest commit: |
4fa54cc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b822949f.espresense.pages.dev |
| Branch Preview URL: | https://fix-latest-manifest-2225.espresense.pages.dev |
Summary
Fixes the root cause of #2225 — "Failed to download manifest".
Root cause
The manifest handler (
functions/releases/[[path]].ts:128) fetched GitHub's/releases/tags/${tag}endpoint. Whentag === 'latest', GitHub returns 404 becauselatestis not a real Git tag. The handler propagated the 404 as{"error":"Release not found"}, which the web installer surfaced as a generic "Failed to download manifest" toast.The sibling
/latest/download/:filenameroute (line 204) already used the correct/releases/latestendpoint — the manifest handler was never updated to match.Fix
latestcorrectly: whentag === 'latest', fetch from/releases/latest(GitHub's endpoint for the newest non-prerelease) instead of/releases/tags/latest.rel.tag_name(the real tag, e.g.v4.0.6) instead of the literal${tag}, solatestmanifests produce workingdownload/v4.0.6/*.binURLs rather than nonexistentdownload/latest/*.binpaths.wrangler.toml: add missingcompatibility_date(was absent; localwrangler pages devdefaulted to today and exceeded the bundled workerd).Verification
Before (production, GHA run #29879346118):
After (local wrangler pages dev):
After (Cloudflare Pages preview deployment):
The manifest-check tool used for verification is in the companion PR (linked below).
Refs: #2225.