Commit Graph
2 Commits
Author SHA1 Message Date
yetone 1a85394329 update: a feed a release behind keeps the version downloaded (Restart to update stayed on v0.1.2037)
littleHong on Discord: v0.1.2037 offered v0.1.2038 with no notes; Restart
to update restarted nothing and the app stayed on v0.1.2037.

Restart to update asks the feed again first (recheck). run() dropped the
found version and its verified download whenever the feed named an older
one, a rule meant for Settings' Update channel going to Stable
(4a33cf0a9). The site, short of GitHub's API (no GITHUB_TOKEN secret on
the worker, so anonymous and rate-limited), answers from GitHub's latest
redirect or its kept latest-good answer, which can be a release or more
behind. Then the download was dropped, the state was "latest" or a fresh
download began, and no restart happened. The same degraded path takes
notes from GitHub's Atom feed, which lags new releases: the sheet's
"no release notes" is that. The cause is inferred from the code and the
worker's state; the reporter's own logs weren't available (the macOS GUI
logs to stderr only).

Now the drop happens only when the channel changed since the version was
found (u.stable records it). On the same channel the version found and
its download stand. Trade-off: a release withdrawn after it was
downloaded still installs.

Ruled out on mote with the real artifacts: update.Stage from a real
v0.1.2037 bundle to v0.1.2038's zip (hash, ditto, codesign, team
LY7MVTUDZG) and update.Install swapped the bundle; codesign "valid on
disk", spctl "accepted, Notarized Developer ID". All 16 v0.1.2038 assets
were up at 10:24:15Z, before its publish at 10:24:24Z.

Run (mote-run, this tree on origin/main 9f36d768d; the update tests again after
rebasing onto dd9828f2b, ok):
- gofmt -l internal/gui: clean
- go vet ./internal/gui (darwin), GOOS=linux go vet -tags nogui, GOOS=windows
  go vet: ok
- go test -run 'TestUpdate|Channel|WhatsNew' ./internal/gui: ok
- broken by hand (drop on every older answer, the old rule):
  TestUpdateFeedBehindKeepsDownload red ("Latest:0.1.11 ... 2 downloads");
  TestUpdateChannelSwitch stays green with the fix
- go test ./internal/gui ./internal/update: update ok; gui ok except
  TestMainWindowCorners/macOS_26_SDK, mote's macOS 27, filed as #3949

Not tried: a real GUI restart against a site answering a release behind.
2026-10-29 18:55:42 +08:00
yetone 4a33cf0a98 update: a Stable channel in Settings → About, and magpie update channel
ssharpcc on X reads every changelog before updating, for fear of a ban
when behind, and with many releases a day that is a lot of reading.
Settings → About → Update channel (zh: 更新渠道, 稳定版 / 每个版本) picks
Every version, the default and today's behaviour, or Stable: one version
a week, the newest that had been out three days as the week began
(Monday 00:00 UTC), and an urgent release at once. usemagpie.ai chooses
it from the release list (the previous commit); a release is urgent when
a line of its notes starts with "**Urgent release:**", which
magpie-releases' release run writes from an `Urgent: <why>` trailer
(magpie-releases 73f6cff).

- settings: updateChannel, "" or "stable"; anything else is refused.
- update: on Stable the feed is asked with channel=stable; What's new
  shows every release since the installed one (up to 1500) instead of
  the newest 40, so a week's notes read as one list.
- gui: the row is segs, never a <select>; a save that doesn't send the
  channel keeps it; switching asks the feed again at once, and a
  download from every version newer than Stable's pick is dropped,
  never restarted into. What's new's notes are kept per channel.
- cli: magpie update channel [stable|every] ("all" too), and it says
  which with nothing after it.
- docs: reference.md's Update channel (the rule and the marker); the
  privacy pages (en, zh, ja) name ?channel=stable on /api/latest.

The full Go and GUI suites were not run: the disk was at 3 GB free and
other sessions had GUI suites and a 45-minute gateway run going the
whole time.

Run, at this tree before the rebase:
- gofmt -l (clean); go vet on darwin, GOOS=linux -tags nogui and
  GOOS=windows for ./internal/update/... ./internal/cli/...
  ./internal/settings/... ./internal/gui/.
- go test -count=1 ./internal/update/... ./internal/cli/...
  ./internal/settings/...: ok. ./internal/gui -run
  'TestUpdateChannelSwitch|TestWhatsNewKeyedByChannel|TestCoreScriptBudget':
  ok (the app.js budget passes).
- GUI, chromium and webkit: update-channel (22: en, zh, zh-TW, ja, de at
  900 and 420 wide: default lit, Stable saved, kept by another save,
  kept over a reload, Every saved back, no click scrolls, no sideways
  scroll at 420), i18n-keys, gui-ja, gui-de, gui-zh-tw and every
  update-*.test.cjs: 253 of 253 pass.
- The live feed: /api/latest?channel=stable answers 0.1.1327 (out
  2026-10-22 21:55 UTC, the last before Friday 10-23 00:00) with 15
  assets after the first real cron run filled the ledger (400 releases
  back to 10-10); /api/notes 0.1.1200..0.1.1327 gives 124 notes, none
  empty (1213 and 1218 were never published).

After rebasing on afc99490f: TestCoreScriptBudget, the channel Go tests
(update, cli, gui) and GUI i18n-keys + update-channel (both engines,
26 of 26) pass again.

Broken by hand, each red: the feed asked without channel=stable
(TestLatestAsksTheChannel); Stable capped at 40 (TestStableNotesAreAll);
any channel saved (TestUpdateChannelSaved); "all" dropped
(TestUpdateChannelCmd); a save without the field clearing it, no new ask
on a switch, the newer download kept (TestUpdateChannelSwitch); one
notes key for both channels, What's new capped at 40 on Stable
(TestWhatsNewKeyedByChannel); app.js's other saves dropping the channel,
Stable's click saving "" (update-channel 11 of 11 red); the zh label or
a de subtitle taken out (update-channel and i18n-keys red).

Not tried: the full go test ./... and the whole GUI suite (above); a
real app switching channel against the live feed; Windows and Linux
runs (vet only); a real urgent release.

Requested by ssharpcc on X.
2026-10-26 21:09:44 +08:00