Text chat 72: fluxer-platform updater: feed client, resumable verified download, install targets and apply (#434) #467
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-72-platform-updater"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: origin/textchat-69-proto-update-manifest, origin/textchat-71-core-updater
What
fluxer-platform::update(update spec §5):http:UpdateHttp::new(user_agent)(reqwest, 15 s connect / 60 s read, no cookies, no auth, redirects only to the first request's origin) andfetch_manifest(&feed_base, channel)(<base>/<channel>.json, 256 KiB cap, 404 =NotPublished, parsed withfluxer_proto::update::parse_manifestagainst the feed file URL);FEED_BASE.download:Downloader::download(&asset, &dir, progress):.part+.part.meta(validator, asset hash/size), resume withRange+If-Range, 200/416 restart, never writes past the manifest size, SHA-256 after completion, fsync + rename + dir fsync, progress throttled to 10 Hz;DownloadError(no URL/path in any message),CancelToken,VerifyPolicy::Sha256Only.target:InstallTarget,detect_install/detect_install_as(TargetOs, …)with injectableEnvSourceandVelopackProbe,capability_for(kind/target matrix +minimum_version),staging_dir.appimage::{apply, relaunch},sweep::sweep_leftovers.velopack: pureupdate_options,check_agrees,progress_to_bytes(tested on every OS);VelopackInstallProbe,startup_hook(); Windows-onlyVelopackUpdater::{open, download, pending, apply_on_exit},PendingUpdate.settings.rs:[update] channel / automatic(absent table = defaults, unknown channel =Nonewith a warning, wrong type costs only that value).Tests
FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally (Linux). New:tests/update_feed.rs(7),tests/update_download.rs(11),tests/update_apply.rs(12), 3 settings tests, unit tests inupdate/velopack.rsandupdate/http.rs. All tests named in the plan are present.velopack_crate_version_matches_vpk_versionruns on every OS (pure file reads), not only on Windows;not_installed_exe_probe_is_falseis#[cfg(windows)].Windows-only code: this PR adds code that compiles only on Windows (
update/velopack.rs,mod imp). I could not build the real crate graph for Windows here (no MSVC headers for ring), so I checkedvelopack.rswithcargo clippy --target x86_64-pc-windows-msvc --all-targets -- -D warnings -W clippy::pedanticin a scratch crate against velopack 1.2.161 (ureq TLS features off only for that check): clean. Please watch the Windows runner.deny.toml changes
webpki-roots→CDLA-Permissive-2.0(ureq via velopack)RUSTSEC-2024-0388(derivative, unmaintained) andRUSTSEC-2026-0367,-0368,-0369,-0429(zip 8.6.0 vulnerabilities inZipArchive::extract/ZipStreamReader::extract; velopack 1.2.161 requires zip 8 and never calls those APIs, seesrc/bundle.rs). Not anticipated by the plan; follow-up #466 to bump vpk + crate together to a release on zip 9.Deviations from the plan
FeedError::TooLargeadded (oversize manifest);DownloadError::Cancelledadded (cancel needs a variant).StagedFile { path, size }instead of{ path, version }(the asset carries no version; the caller knows it).Downloaderfield (downloader.cancel), keepingdownload's signature as specified.detect_install_as(TargetOs, …)added so the Windows rules are tested on Linux;staging_dir_name,DownloadError::is_verification,ApplyErrordefined here.startup_hook()andVelopackInstallProbeexist on every OS (no-op / false off Windows) so Text chat 74 needs nocfg.HttpSource::newwithout options: velopack'sHttpOptionsonly has a whole-request timeout, which would cut large downloads.relaunchusesprocess_group(0)instead ofsetsid(nolibcdependency) and stripsAPPIMAGE/APPDIR/ARGV0/OWD.max_deltas= 10 (Velopack's default), so deltas work once the release job packs them.logcrate including URLs with a query; keep targetvelopackat warn.Closes #434
🤖 Generated with Claude Code
Independent review: Text chat 72 (platform updater)
Scope:
git diff ba7a8ae..origin/textchat-72-platform-updater(3 commits,970c27c).Tests named by the plan: all 37 exist (feed 5, download 10, targets 9, apply 3, Velopack pure 3, Windows-only 2, settings 3), and they assert what the plan says:
2026.105.412vs2026.0105.412, 256 KiB cap, 404 →NotPublished, off-origin 302 refused / same-origin/attachments/…followed, noauthorization/cookie,Range: bytes=<len>-+If-Range, size cap respected during the write, verification failures delete the file, cancel keeps.part, progress ≤ 10 Hz.velopack_crate_version_matches_vpk_versionruns on every OS and passes (=1.2.161=VPK_VERSION).Interfaces: all present with the plan's signatures (
UpdateHttp::new/fetch_manifest,FEED_BASE,Downloader::download,DownloadError(+Cancelled),CancelToken,VerifyPolicyfield,InstallTarget,detect_install(&impl EnvSource, &Path, &dyn VelopackProbe),staging_dir,capability_forwith the plan's kind/target matrix,appimage::{apply, relaunch},sweep_leftovers,update_options/VelopackOptions,check_agrees,progress_to_bytes,VelopackUpdater::{open, download, pending, apply_on_exit},startup_hook). Deviations (StagedFile { path, size }, cancel token as aDownloaderfield,FeedError::TooLarge,detect_install_as) don't break Task 74's listed consumption.Velopack API checked against the 1.2.161 source:
UpdateOptionsfields,UpdateCheckvariants, the exhaustivevelopack::Errormatch (incl. the cfg(windows)Win32),UpdateManager: Clone,AsRef<VelopackAsset>andHttpSource::newall match. Velopack calls no zipextract()(only comments mention it), so the deny.toml claim holds.Invariants: only
fluxer-platform(plus workspaceCargo.toml,deny.toml,Cargo.lock) changed. No core/ui/emoji changes, no secrets, no URL/path in any errorDisplayor log line of this crate.[update]round-trips, and a value of the wrong type costs only that value.Findings
download()deletes an existing<name>of the same size whose hash doesn't match, and the final rename overwrites any existing<name>. That only matters for a user file with exactly the asset's name, but a unique name (or skipping the delete outside the staging dir) would be safer.changed_etag_restarts_from_zerochecks only the final bytes. The body is the same on both sides, so it would also pass if the client wrongly resumed. Asserting that the last request got a 200 (or that the file was rewritten from offset 0) would make it bite.localVersion/id/stagingIdquery throughlogat info. Task 74 must keep thevelopacktarget at warn, as the README says, or the "no URL query in logs" rule breaks.velopack.rs's#[cfg(windows)]part was only cross-clippied by the implementer. The integrator must watch the Windows runner after merge.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree passed ("all steps passed"; fmt, clippy, deny with the new exceptions, tests).Verdict: approve. No blocking findings.