Skip to content

fix(host): follow redirects when resolving the latest release tag - #220

Merged
tanlethanh merged 2 commits into
mainfrom
fix/update-check-redirect
Aug 27, 2026
Merged

tanlethanh merged 2 commits into
mainfrom
fix/update-check-redirect

Conversation

@tanlethanh

@tanlethanh tanlethanh commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

zedra update failed for every installed host with failed to resolve latest release tag from GitHub.

resolve_latest_tag used redirect::Policy::none() and read hop #1's Location, assuming GitHub answers /releases/latest with a single 302 to /releases/tag/vX.Y.Z. After the repository moved owners, hop #1 became the rename 301 to the new owner's /releases/latest, so the parsed tag was latest and the starts_with('v') guard rejected it.

Now the client follows redirects and reads the tag off the final URL, which makes any future owner or name change transparent to the updater.

Notes

  • The download path already used a redirect-following client, so zedra update --version vX.Y.Z kept working — only tag resolution broke.
  • The repository has been moved back to tanlethanh/zedra, so old binaries resolve tags again without this fix; the fix is what makes a future move safe.
  • Ships as v0.4.4, published as a pre-release so /releases/latest stays on v0.4.3 until it is promoted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rucg8rUeVtQhjeJfAGs4Uk

## Summary

`resolve_latest_tag` built a client with `redirect::Policy::none()` and read
the `Location` header of the first response, assuming GitHub answers
`/releases/latest` with a single 302 to `/releases/tag/vX.Y.Z`.

When the repository was moved to another owner, hop #1 became the rename 301
to the new owner's `/releases/latest`, so the parsed tag was `latest` and
every `zedra update` failed with "failed to resolve latest release tag from
GitHub".

Follow redirects and read the tag off the final URL instead.

## Notes

- The download path already used a redirect-following client, so
  `zedra update --version vX.Y.Z` kept working throughout — only tag
  resolution broke.
- Makes any future owner or name change transparent to the updater.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rucg8rUeVtQhjeJfAGs4Uk
@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
zedra Ignored Ignored Preview Aug 27, 2026 12:23pm

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rucg8rUeVtQhjeJfAGs4Uk
@tanlethanh
tanlethanh force-pushed the fix/update-check-redirect branch from 0a11df6 to f283fa1 Compare August 27, 2026 12:22
@tanlethanh
tanlethanh merged commit 35f86b4 into main Aug 27, 2026
5 checks passed
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