Commit Graph
8 Commits
Author SHA1 Message Date
yetone db7c576706 update: a list of the newest 40 says how many releases there are in all
sujingshen on X, v0.1.2606 to v0.1.2762: the update sheet read "40 个版本"
for about 156 releases. The app keeps only the newest update.MostNotes
(40) and counted the list it kept, so the line named the cap, not the gap.

update.NotesBetweenTotal returns the count of every release in the range
beside the capped list. /api/update/notes and /api/whatsnew send it as
`total` when it is more than the list, and mergedNotes then reads
"156 releases · the newest 40 shown, v… – v…" (en, zh, zh-TW, ja, de).
Settings' What's new, where withWaiting puts pending releases first and
cuts again, sends no total, since that count was of the installed ones.

Run on mote at this tree: gofmt -l internal clean; GOOS=windows go vet
and GOOS=linux go vet -tags nogui of internal/gui and internal/update ok
(the cgo Linux vet needs gtk4/webkitgtk dev packages neither mote nor
magpie-desktop has); go test ./internal/update ok (new
TestNotesBetweenTotalPastTheCap: 56 releases keep 40 with total 56, 6
keep 6 with total 6); go test ./internal/gui ok except
TestMainWindowCorners, the macOS 27 red of #3949. GUI files in chromium
and webkit: update-notes-ask 16/16 (new: a list cut short says how many,
en and zh), whats-new 4/4 (new case: 156 in all), whats-new-range 12/12,
whats-new-failed 4/4, i18n-keys 4/4.

Not tried: a real update from an install 156 releases back.
2026-11-03 06:35:33 +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
yetone 761904b5ab whatsnew: Settings' What's new can show this version and the 10, 20, 50 or 100 before it (Linka)
Linka (linkaww, Discord, 10-25): 希望「关于 - 更新内容」加个可选项,查看
「上次更新以来 / 当前版本前 10 / 20 / 50 / 100 个版本」的更新说明.

Settings › About › What's new now has a pill in its head (the app's
menu, sess-pick, never a native select): "Since the last update", the
default and what it showed before, or "This version and {n} before" for
10, 20, 50 and 100. The dialog shown by itself after an update has no
pill and is unchanged.

- site/worker.js: /api/notes takes limit=, the newest that many after
  upto, so a request for 11 isn't answered with 100.
- internal/update: NotesBack(ctx, upto, n, lang) asks upto and limit
  n+1; Back(notes, upto, n) keeps upto and the n releases before it,
  newest first, Install sections stripped, empties dropped. It is not
  capped at MaxNotes (40), which only Between keeps.
- internal/gui/whatsnew.go: /api/whatsnew?all=1&last=N, for N in
  10/20/50/100 only (anything else is the default). Cached per language,
  the longest range asked kept, and a shorter one cut from it, so
  picking 10 after 100 asks nothing and a reopen asks nothing. A failed
  fetch is unknown: the reply carries error and whatever range was had
  before.
- app.js: openWhatsNew(b, last) and wnRange. A pick that fails keeps
  the notes last shown, says "Couldn't load the release notes" with Try
  again above them, and Try again asks the same range.
- The archive helpers (archivedCalls, headersPanel, downloadArchive,
  archiveBodyPanel), used only by the Usage page, moved to
  plugins/usage/page.js as d08b6118b did, so app.js stays under its
  budget (1,319,177 of 1,321,336); no budget raised.
- i18n: three strings in zh, zh-TW, ja and de.

Run at the pushed head (rebased on origin/main 0d2a10116):
- go test -count=1 -tags nogui ./internal/update/ ./internal/gui/ in a
  sandbox HOME: ok (TestNotesBack, TestWhatsNewBackRanges,
  TestCoreScriptBudget among them).
- gofmt -l: none. go build ./...; go vet ./...; GOOS=linux go vet -tags
  nogui ./...; GOOS=windows go vet ./...: ok.
- node --test site/worker.test.mjs: 21 pass (new: limit keeps the
  newest that many up to upto; "", 0, x and -1 mean no limit).
- GUI at this head, both engines: whats-new-range (new), whats-new,
  whats-new-failed, i18n-keys, ledger-cache-unknown, request-archive and
  request-archive-usage (the Usage page holds the moved helpers): 50 of
  50. whats-new-range.test.cjs alone is 12 of 12: five languages x two
  engines plus the post-update dialog in both. Covers the default label
  and no last= asked, the menu's head and five items, 10 then 100,
  the same pick asking nothing, a failed 50 keeping the 100 shown with
  the error above, Try again, no scroll, no left-border accent, and a
  440px window with the pill inside the dialog.
- Whole GUI suite (869 files), chromium then webkit, concurrency 4:
  still running at push time, started at 1f156ba40 (the same change on
  e57e78563); the tree was rebased under it at 01:45. Chromium at 01:46:
  1725 top-level tests passed, 7 red, none in a What's new or Usage file:
  agents' sign-ins, Plugins › Built-in, zh-TW 420px context map, gateway
  mode, an MCP server out of the library, and "a menu opened from a long
  text box's rule stays open" (en, zh). They will be checked against
  origin/main and filed or fixed when the run ends. Before the rebase,
  usage-ledger's "newest live route needs no return-to-live button" was
  red here and on an origin/main e57e78563 copy alike (#3104, #3001).

Broken by hand, each red, then restored:
- the pill not added to the head: whats-new-range red.
- the kept notes not used on a failure: red at "the notes shown before
  are kept".
- the ?last= route skipped: TestWhatsNewBackRanges red.
- Back not cutting to n+1: TestNotesBack red.

Not tried:
- the real site: the test fakes /api/notes and /api/whatsnew. The site
  holds GitHub's newest 100 releases, so "100 before" on the newest
  version can show at most 100. An undeployed site ignores limit; the
  app cuts the list itself.
- the real app window (Wails/WebKitGTK); only Playwright's engines.
- go test ./... in full was not run: the machine had a queue of other
  sessions' full suites, and the owner's rule is not to hold a verified
  commit behind one.

Known limits: a range view carries no pending (waiting update) notes;
if a longer cached range dropped an Install-only release, a range cut
from it can reach one release further back than a fresh ask would.
2026-10-25 01:46:55 +08:00
yetone 8c62702442 whatsnew: Settings lists every release up to the waiting update, not its notes alone
小八 on Discord (10-24): on 0.1.1398 with 0.1.1409 out, Settings › About ›
What's new showed 0.1.1409, then 0.1.1398 and older; 0.1.1399 to
0.1.1408 were missing.

Cause: openWhatsNew (app.js) took /api/whatsnew?all=1, which lists the
running version's notes (or those since the last upgrade), and put the
waiting update's own notes (/api/update's u.notes) on top. Nothing asked
for the releases between the running version and the update. The site's
/api/notes had them (checked live: after=0.1.1398&upto=0.1.1409 returns
all ten, 0.1.1407 was never released).

Fix: /api/whatsnew?all=1 now puts first, while an update waits (ready,
available, downloading, found), the notes of every release after the
running version up to it (withWaiting, through fetchNotes as the restart
dialog's update/notes has them), each marked pending ("Not installed
yet"); the site out of reach leaves the update's own notes, as before.
update.Note gets Pending. The page shows what the app sends, so
openWhatsNew no longer asks /api/update or merges (app.js 265 bytes
smaller). Not changed: the restart dialog (confirmUpdate) already asks
update/notes for the range; the popup after an upgrade lists after..now
through Between, which was right; the site's degraded path (API refused:
the Atom feed's newest 10 plus the last whole list) can still leave a gap
when more than 10 releases came out since the list was last whole.

Run (worktree at origin/main 0df6a3aba, sandbox HOME, caches pinned):
- TestWhatsNewListsEveryReleaseUpToTheWaitingUpdate (new): the site's
  list shaped as magpie-releases had it (0.1.1396 to 0.1.1411, no
  0.1.1407, Install sections), running 0.1.1398 with 0.1.1409 waiting in
  each of the four states: 1409..1399 pending, then 1398 and older; site
  down: the update's own then the kept; nothing waiting: none pending.
  Broken by hand (route without withWaiting): FAIL "ready: pending [],
  want [0.1.1409 ... 0.1.1399]"; restored: ok.
- go test -tags nogui ./internal/gui/ ok (175s, TestCoreScriptBudget
  included). ./internal/update/: TestRelaunchStartsTheBundleWhenOpenNeverWorks
  red once at 30s while the disk was full and load ~50; -count=3 alone
  ok; filed #3499.
- GUI (Playwright 1.62.0, Chromium and WebKit, en and zh):
  whats-new (now a waiting 0.1.607 with 0.1.605/0.1.606 between, all three
  badged), whats-new-failed: 8/8 pass. segs-glide, update-check,
  update-hide, update-notes-ask, update-stuck, update-row-held,
  update-wait, i18n-keys, menu-scroll: 160/160 pass.
- gofmt -l clean; go vet ./...; GOOS=linux go vet -tags nogui and
  GOOS=windows go vet on gui and update; go build, GOOS=linux -tags
  nogui build, GOOS=windows build: all ok.

Not tried: the full go test ./... (the disk was full; other sessions'
builds hit ENOSPC); the real app against the live site with an update
waiting; gui-zh-tw/ja/de runs (no strings changed).
2026-10-24 22:54:36 +08:00
yetone e5f8ff6026 site, gui: release notes survive GitHub limiting usemagpie.ai, and a failure to get them says so, apart from a release without any (#661) — /api/notes answered 503 {"error":"no releases"} with Cache-Control public, max-age=300 whenever GitHub's API limited the worker's shared IP, and /api/latest fell back to the release page's redirect with notes "" (kept 300 s too), so the update window had nothing to show. The worker now: never keeps an error (503 is no-store); takes the notes from GitHub's releases feed (releases.atom, not API-limited) when the API says no, turning its HTML back into the markdown the app draws and putting back the <!-- lang:zh --> marker GitHub strips (before the first Chinese heading after an English one); keeps the last whole answer for 30 days in the edge cache and serves it (merged with the feed's newer releases) when GitHub fails; keeps a degraded answer 60 s instead of 300; and sends a GITHUB_TOKEN secret to the API where one is set (none is yet). In the app, /api/whatsnew says error (and the release page's url) when the notes couldn't be had, and Settings' What's new opens a dialog saying "Couldn't load the release notes" with Try again and "Open the release page" (through the app), or "No release notes provided." with the release page and no retry for a version with none, instead of a passing toast; en/zh. Tests that fail on the old code and pass: site/worker.test.mjs (API limited: notes from the feed in either language, briefly kept; all of GitHub down: 503 no-store, then the last whole answer; the token sent), TestWhatsNewTellsFailureFromNone, and whats-new-failed.test.cjs (WebKit, en/zh: failure with retry and link, retry showing the notes, none without retry, no click moves the page). The feed parser was tried on the real releases.atom (v0.1.730–739: English and Chinese split as the API's bodies are). go vet, builds (darwin, GOOS=linux, GOOS=windows), go test -tags nogui -count=1 ./... under a temp HOME, node --test site/ and whats-new.test.cjs pass. 2026-10-03 17:12:48 +08:00
yetone e2a22596cc update: What's new leaves out the Chinese notes' 安装 section too (#649) — every release's notes end with an Install section that StripInstall takes out, but it matched only the English heading, so with magpie in Chinese each release in What's new repeated 从 usemagpie.ai 下载… StripInstall now knows the heading in each language the notes come in (Install, 安装, 安裝, インストール); a bullet that merely mentions 安装 stays. TestStripInstall covers it and fails on the old code. 2026-10-03 15:00:01 +08:00
yetone aa42142ea5 update: What's new and the waiting update's notes follow the app's language (freecss on Discord: 更新后的公告的语言是不是应该设置里面的走) — the release notes were English alone. A release's notes are to carry a Simplified Chinese translation below a <!-- lang:zh --> marker (the magpie-releases workflow, changed separately); usemagpie.ai's /api/latest and /api/notes take ?lang=zh for the Chinese where a release has it, and give anything else, an app from before included, the English alone, everything above the marker. The page asks /api/whatsnew, /api/update and /api/update/check in its own language (?lang=); magpie asks the site in it, keeps What's new's notes per language, and asks again for the waiting update's notes when a page's language isn't the one they are held in (at most once a minute); a check by itself asks in the pages' last language, else the app's, as the tray menu has it. Notes that come back whole (a site not yet deployed) are cut in the app too; notes without the marker (every release so far) are English, in either language. The worker must be deployed (npx wrangler deploy in site/) before the workflow change ships, or apps would get both languages. TestInLang, TestFeedsAskInLang, TestAskedLang, TestWhatsNewInPageLang, TestUpdateNotesInPageLang, site/worker.test.mjs (node --test site/worker.test.mjs), whats-new.test.cjs's language check (Chromium and WebKit, en and zh); update-check, update-hide, update-auto, sync-update pass in WebKit. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestClaudeRunEndsWhenTheClientLeaves flaked once under the full run, passes alone; gateway untouched). 2026-10-02 11:31:11 +08:00
yetone f22218a092 gui: after an update the window shows what changed since the version last run (a Discord user: 点更新后能弹个窗显示更新了啥吗, to see whether their issue was fixed) — magpie updated itself silently, and its release notes were only on GitHub. The version last run is now kept in magpie's own folder (last-version); started on a newer release, the window or magpie web's page asks usemagpie.ai's new /api/notes (beside /api/latest; site/worker.js lists the releases' notes from GitHub, cached as the feed is) for every release since, newest first, without their Install section, and shows them once in a What's new dialog. A fresh install, the same version, a downgrade or a build from source shows nothing; a magpie from before the version was kept, already in use, shows its own version's notes; offline nothing is shown and nothing waits on it; until the site is deployed, the update feed's newest notes stand in when they are the current version's. The tray's panel shows no dialog. The notes are drawn as text, never as HTML: headings, bullets, bold, code, http(s) links, and #NNN links to the issue, opened in the browser as the app's other links are. Settings has a What's new row under Version that opens them again, with a waiting update's notes first, marked Not installed yet; /api/update's notes leave out the Install section too. TestShowNotes, TestStripInstall, TestBetween, TestNotesBetween, TestWhatsNewAfterUpgrade, TestWhatsNewFromBefore, TestUpdateNotesWithoutInstall and whats-new.test.cjs (Chromium, WebKit, en, zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; click-scroll, old-webkit, update-check, update-hide pass. 2026-10-02 03:57:55 +08:00