Updater harness: hash the pending update file; updater RC proof notes

This commit is contained in:
omar committed 2026-10-24 07:30:23 +03:00
1 parent f97a651c87
commit 65f36a3c1c
2 files changed
+55 -2

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
# Update proof: v0.1.2-rc.1 → v0.1.2-rc.2 (2026-10-24)
Both releases are published prereleases of <https://git.eeee.moe/TeamsPeach/client>, built by the release
workflow (Linux; runs #29 / id 4372 for rc.1 at `d505890`, #32 / id 4375 for rc.2 at `ed2e123`) with the
Windows x64 assets appended by `publish-release.mjs --append` (feed `rc.yml` last). All facts below were read
anonymously.
## Publication
- rc.1 publish log: both Linux feeds passed `update-feed-check` before upload; packages uploaded first,
`rc-linux-arm64.yml` and `rc-linux.yml` last; draft → published, `prerelease: true`.
- `rc-linux.yml` (rc.1) lists exactly `TeamsPeach-0.1.2-rc.1.AppImage`, size 121458950; `rc.yml` (rc.1) lists
exactly `TeamsPeach-0.1.2-rc.1-win-x64-setup.exe`, size 114536343.
- Before the Windows append, a Windows installation of 0.1.1 was correctly told nothing installable exists:
`newerWithoutBuild: [0.1.2-rc.1, no-feed, rc.yml]`, phase `up-to-date`.
## Linux x64 AppImage: real self-update (CI, disposable)
Workflow `update-e2e` run #33 (id 4376), job `appimage-x64` success, `node:22-bookworm` container, Xvfb,
`APPIMAGE_EXTRACT_AND_RUN=1`, temp profile and cache (`scripts/update-e2e.mjs`):
| Step | Result |
|---|---|
| old published rc.1 AppImage running, new identity | version 0.1.2-rc.1, UID `geBfMQuWT6Ld6UPgUyd000Wc0Hk=`, nickname UpdateProof |
| check (real server) | phase `downloaded`, offered 0.1.2-rc.2, asset `TeamsPeach-0.1.2-rc.2.AppImage`, no skips |
| install (user confirmation) | `{ ok: true }`, old process exit code 0 |
| automatic relaunch | new process logged version 0.1.2-rc.2; its own window reports 0.1.2-rc.2 and the same UID |
| installed file | only `TeamsPeach-0.1.2-rc.2.AppImage` in the directory; sha512 equals `rc-linux.yml` |
| fresh start of the new AppImage | version 0.1.2-rc.2; UID, nickname, bookmark and input-device pref unchanged |
## Windows x64: real check + download + sha512, no install
`scripts/update-live-check.mjs` on the developer PC (real `NsisUpdater`, temp profile and cache, never installs):
- as 0.1.2-rc.1, channel preview: phase `downloaded`, offered 0.1.2-rc.2,
`TeamsPeach-0.1.2-rc.2-win-x64-setup.exe`, downloaded file sha512 equals `rc.yml`
(`jX4BvM+N9Wrbfrk…tsl6g==`);
- as 0.1.2-rc.1, channel stable: `up-to-date`, `newerPreview: 0.1.2-rc.2`;
- as 0.1.2-rc.2: `up-to-date` (same version not offered);
- as 0.1.1 (before rc.2): offered 0.1.2-rc.1, downloaded file sha512 equals the rc.1 `rc.yml`.
## Not verified
- **Windows NSIS install/relaunch.** Not run on the owner's account: the silent installer relaunches through
Explorer (`StdUtils.ExecShellAsUser`, electron-builder `templates/nsis/common.nsh`, `installSection.nsh`),
so a test profile is not carried over, and it installs into the owner's per-user installation. Needs a
separate Windows account or VM. The product refuses NSIS self-update on a custom profile (`custom-profile`).
- Linux arm64 AppImage self-update (feeds and packages published and gate-checked; no arm64 GUI runtime).
- Linux tar.gz / Windows zip: notification only by design.
- Updating from 0.1.1 or older: they have no updater; the first updater-capable version must be installed manually.
+5 -2
View File
@@ -110,10 +110,13 @@ function reset() {
const pick = (s) => ({ phase: s.phase, available: s.available && s.available.version, error: s.error, newerWithoutBuild: s.newerWithoutBuild, newerPreview: s.newerPreview, lastCheckedAt: s.lastCheckedAt });
/** sha512 of the package electron-updater recorded as downloaded (pending/update-info.json → fileName). */
function cachedPackageSha() {
const dir = path.join(process.env.LOCALAPPDATA || process.env.XDG_CACHE_HOME, cacheDirName, 'pending');
const name = fs.existsSync(dir) ? fs.readdirSync(dir).find((n) => n !== 'update-info.json' && !n.startsWith('temp')) : null;
return name ? sha512(fs.readFileSync(path.join(dir, name))) : null;
const infoFile = path.join(dir, 'update-info.json');
if (!fs.existsSync(infoFile)) return null;
const { fileName } = JSON.parse(fs.readFileSync(infoFile, 'utf8'));
return sha512(fs.readFileSync(path.join(dir, fileName)));
}
const scenarios = {