Skip to content

Partner v0.1.4

Choose a tag to compare

@github-actions github-actions released this 09 Nov 17:13
· 22 commits to master since this release

English | 简体中文 | 繁體中文

Partner v0.1.4

An update release. Until now the in-app check walked the release pages only, because api.github.com allows 60 calls an hour per address and a shared egress IP regularly spent them; that path had no release notes, no installer size, and no per-release metadata to read. The check now asks the GitHub REST API first — one JSON document carries the tag, the notes, the installer's name, size and URLs, and the address of its checksum — and keeps the page-walking code as the fallback for exactly the case that made it necessary. The settings page also says which of the two answered, instead of letting a fallback look like the only path there ever was. Nothing in the session, memory or settings format changed; this is a drop-in replacement for v0.1.3.

New

The API is the primary check, the release pages are the fallback

UpdateService used to read releases/latest, follow its redirect to releases/tag/<tag>, and take the installer's name and SHA-256 out of SHA256SUMS.txt. That works without a quota, and it is still what runs when the API cannot answer — but it can only ever produce a version and an installer: the release pages carry no notes, no size and no asset list.

The primary path is now api.github.com/repos/Jaspersol/partner/releases/latest, whose release JSON supplies all of it in one call. Everything the API answers is checked before it is believed:

  • Only HTTPS URLs on GitHub hosts enter the candidate list, and a redirect that ends anywhere else fails the request — a poisoned release document cannot point the download at a host of its choosing.
  • Asset names may not contain a path separator, so a name can never escape the download directory.
  • A release with no usable installer is a failed primary, not an empty answer: the fallback can still name one through the manifest.

A fallback is reported, not hidden

UpdateCheck gained a source field (api or direct), and Settings → General shows a line under the result saying which path answered. A check that had to fall back used to look exactly like one that did not, which is how a rate-limited machine could believe the app had no other way to check.

Fallback behaviour

  • A failed API is not retried on every check. A spent quota (403 with x-ratelimit-remaining: 0), the secondary limit (429, or 403 with Retry-After), an unreachable host and a check timeout each pause the API for 15 minutes; an HTTP error or a malformed answer pauses it for 2, the same as the check cache. The cooldown is a timestamp, so a manual check inside it goes straight to the fallback instead of paying for a request that is known to fail.
  • A missing per-asset checksum falls back too. The API path wants <installer>.exe.sha256 next to the installer; a release that predates it — every release before this one — still updates, because the manifest path takes over. Verification stays mandatory on both paths: with no digest at all, no installer is offered.
  • Both paths down is reported as both. The message keeps the direct failure in front and appends the API one, so "GitHub is unreachable" and "the release has no checksum" do not read the same.

Download

The download now has candidates instead of one URL: the release's browser_download_url, its API asset URL, releases/download/<tag>/<name>, and finally releases/latest/download/<name>. A candidate that fails moves to the next; a checksum mismatch does not — trying another mirror cannot fix bytes that do not match the digest, so it deletes the partial file and stops.

Each attempt downloads from scratch rather than resuming a partial file, because a stream that broke halfway leaves a hash that would never match. The size cap, the MZ header check and the SHA-256 comparison are unchanged, and so is /UPDATE /P: the installer overwrites api/, the shell and the two engine scripts in place and leaves the downloaded engines alone.

Upgrading

  • Install v0.1.4 directly, or let v0.1.3 update itself — both paths lead to the same installer.
  • Every app release now has to publish three assets, and the workflow does: Partner_<version>_x64-setup.exe, <installer>.exe.sha256, and the SHA256SUMS.txt that lists it. The first two feed the API path, the last one the fallback.
  • The engines are still not in the installer: download them from Settings → Local engines; the URLs and SHA-256 stay pinned to the engines-v1 release.
  • The settings, session, memory and workspace formats are unchanged, so an existing install keeps everything.

Engineering

  • UpdateServiceTests grew from 8 fact cases to 16, plus three theories (15 rows). Between them they cover the API as primary, each way the API can be rate-limited, an offline API, a release with no .exe.sha256, both paths failing, the cooldown not being spent twice, a manifest line containing a path, a foreign asset URL in the release JSON, and the download's candidate order, checksum mismatch and non-executable payload.
  • Two frontend tests assert the source line: direct when the fallback answered, api when the primary did.
  • UpdateService takes an injected clock, so the 2-minute cache and the 15-minute cooldown are tested as values rather than by sleeping.

The voice engines are downloaded from the engines-v1 release on first use; their URLs and SHA-256 are pinned in this build. The app code is MIT licensed; the engine runtimes and model weights keep their own licences, see THIRD-PARTY-NOTICES.md in the release assets.