Text chat 71: fluxer-core updater: settings, status machine, checks, apply rules, selectors (#433) #457
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-71-core-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: textchat-69-proto-update-manifest
What this builds
fluxer_core::update(update spec §4) and its selectors (§4.7):UpdateSettings { channel, automatic }(defaultNone,true) asLocalSettings.update;BuildInfo,InstallCapability { Restart, Manual(ManualReason) }(+InstallModealias for the spec's name),ManualReason,DisabledReason { DevBuild, NoPlatform },UpdateStatusas §4.2,UpdatePhase,OfferedRelease,UpdateError,App.update: UpdateState { status, settings_view, failures_by_version, next_check, confirm_restart, manual_result, … }.Effect::Update(UpdateCommand { Check, Download { release, to: Staging | Downloads }, CancelDownload, Apply { relaunch }, RevealDownload }),CoreEvent::Update(UpdateEvent { Started, Checked, Progress, Downloaded, ApplyFailed, Quitting }),UserAction::Update(UpdateAction).Started, thenCHECK_INTERVAL2 h; background failures silent with 15 min backoff doubling to 2 h; manual checks never back off; dev build disabled and schedules nothing; newer = strictly greater version and commit not a prefix match;minimum_version→Manual(BelowMinimumVersion); unknown kind →Manual(UnknownKind); background download only withautomatic && Restart; three verification failures stop background downloads of that version; channel change re-checks at once and cancels the other channel's download (late answers of the old channel are dropped); button onReadyduring a call/own stream (selectors::voice_status/is_streaming) setsconfirm_restart;QuittingreturnsApply { relaunch: false }only whenReadyandautomatic; settings changes are saved withPersistOp::SaveSettings.update_button,update_settings,client_info(app, product, os).Tests
crates/fluxer-core/tests/update.rs: all 29 tests the plan lists (manifests parsed from Task 69'sfixtures/update/withparse_manifest). They failed to compile before the implementation, pass after.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally (base after the stack merge was green too).Deviations (reviewer please look)
UpdateActiongainsRevealDownload("Show in folder" of the manual download modal); the plan's list hasUpdateCommand::RevealDownloadbut no action to trigger it.UpdateStatehas one extra public field,error_open(the error modal of a user-started failure), plusstable_published.ButtonClickedon a user-startedFailedopens the modal; clicked again with the modal open it is "Try again".DismissErrorcloses the error and the manual download modals.LocalSettings.updateis a plainUpdateSettings(2 bytes), not boxed: aBoxpushedPersistOpover clippy'slarge_enum_variantlimit (the field fits in existing padding). The save is done inApp::applyright afterpersist::reduce, which would otherwise have needed a 9th argument (too_many_arguments).client_inforeturns the build line, thenoson a second line (ClientInfo.tsxshows them as separate lines); a dev build readsDevelopment <product> (<commit>).UpToDate { latest: None }(logged); the spec'sNoAssetForPlatformis not aDisabledReasonin the plan.apps/fluxer/src/runtime.rsgets a one-lineEffect::Update(_)debug arm so the exhaustive match compiles (the runtime is Text chat 74);messages.rs/session.rsexhaustive matches getCoreEvent::Update(_).Closes #433
🤖 Generated with Claude Code
Independent review: Text chat 71 (core updater), commit
643e3d3Scope:
git diff 37a8c6f..origin/textchat-71-core-updater(13 files, fluxer-core plus a one-line debug arm inapps/fluxer/src/runtime.rs).Checks
crates/fluxer-core/tests/update.rs. They assert what the plan and update §4/§6 say: 10 s first check,CHECK_INTERVALof 2 h, backoff 15/30/60/120/120/120 min that resets on success, manual check never backs off, prefix-commit match, 404 →UpToDate { latest: None },BelowMinimumVersion/UnknownKind/ReadOnlyLocation→Manual, a call from the fixture connected through the real gateway and voice events →confirm_restart, quit applies withrelaunch: falseonly whenautomaticis on, 3 verification failures block that version and a newer one downloads again, the channel switch sendsCancelDownloadthenCheck{Stable}and drops the late nightly answer, the tooltips "Update available" / "Updating… 42%" / "Updating…" / "Update failed", and "Nightly Flaxative 2026.1113.412 (5817ae6c0d1e)".UpdateSettings,BuildInfo,InstallCapability/ManualReason(incl.Unsupported),DisabledReason { DevBuild, NoPlatform },UpdateStatus(as §4.2),OfferedRelease,UpdateError,UpdateState(all of the plan's public fields),UpdateCommand,DownloadTo,UpdateEvent,DownloadedFile,UpdateAction,Effect::Update,CoreEvent::Update,UserAction::Updateand the three selectors with their model structs all exist as written. The deviations only add things (UpdateAction::RevealDownload,UpdateCommand::RevealDownloadwas already in the plan,error_open,stable_published), except the two in the findings below.urlandtracingwere already used). No iced, wgpu, winit, reqwest or tungstenite, and no I/O.UpdateError's strings are runtime-supplied plain words. The only path-like data arepath_display/location_display, which the plan prescribes, and no log line logs them (the wrong-version warning logs versions only; the runtime stub does not log the command).OpenNotesonly opens http(s) URLs. No secrets in the fixtures.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cirun in the review worktree: green ("all steps passed";tests/update.rs29/29).Findings
stable_publishedis only learned when the user already follows stable (on_checkedrecords it, but the core issuesCheck { channel: Stable }only for the followed channel). For a nightly user it staysNone, so the Stable option can never be disabled with "No stable release yet" before it is picked (update §6.2). Suggestion: one probeCheck { Stable }after the first nightly check (the recording inon_checkedalready happens before the pending-channel filter), or Task 73/74 decide it. Worth a follow-up issue if not fixed here.LocalSettings.updateis a plainUpdateSettings, not boxed as the plan says. Field access is unchanged. Task 72 must construct it unboxed. Acceptable given clippy'slarge_enum_variant.client_info(app, product, os)returns"<line>\n<os>", while the plan's example is a single line. Task 73'sclient_info::view(line)must handle the two lines, or pass an emptyosto get only the first line.Availablethat fails givesFailed { release: None }.DismissErrorthen goes toIdle, so the offered release's button disappears until the next 2 h check (the background path restoresbefore_check, the manual path does not).SetChannel(c)wherecis the build's own channel and the setting isNonestoresSome(c). The user is then pinned instead of following the build's default. This is harmless today (every build is nightly).Also noted, no action needed: the
[update]table is not read or written byfluxer-platformyet (Task 72), so changes reachSaveSettingsbut are not on disk until 72 lands. The implementer's stash incident does not touch this branch's tree.Verdict: approved. Zero blocking findings, local ci green.