Skip to content

fix(updates): never send an installer from an unknown Packages state - #408

Merged
andrescera merged 4 commits into
mainfrom
fix/packages-button-no-legacy-fallback
Oct 23, 2026
Merged

andrescera merged 4 commits into
mainfrom
fix/packages-button-no-legacy-fallback

Conversation

@andrescera

Copy link
Copy Markdown
Member

What

The Packages section's Update button no longer sends any installer while the device's update capability is unknown, still loading, failed to read, or belongs to a previous connection. In that state the button (and its confirmation) is disabled, and a direct call sends nothing. Once the capability is confirmed for the current connection:

  • explicit legacy device: system.startUpdate (unchanged);
  • capable device in a package phase (available / awaiting-idle): the tracked system.installUpdatesNow {scope:"packages"} (unchanged), and a scoped refusal never retries through the legacy route (unchanged);
  • capable device in any other known phase (idle, OS image on offer, failed, quarantined, ...): system.startUpdate exactly as before (documented residual, see Risks).

No backend, wire schema, locale key or user-visible string changes. Engineering docs (README.md, docs/DEVICE-UPDATES.md, docs/agents/the-device-update-system.md, the backend orchestrator doc paragraph) describe the final routing.

Why

Hardware runs on an Orange Pi (capable image) showed the Packages Update intermittently dispatching the legacy system.startUpdate instead of the tracked route even though the orchestrator phase was already available: the old predicate fell back to the legacy installer whenever the capability declaration was not yet known (in flight, rejected, timed out, or stale). The device journal showed the legacy route's own refusal at the failing times, and once the legacy route performed the install and left the orchestrator phase stale. The legacy route skips orchestrator admission, the cellular gate and phase bookkeeping, so an unknown state must never be allowed to pick it.

How to verify

  • New tests fail on 149751ce for the right reason (unknown/failed/stale/closed/previous-link/in-flight/phase-not-received states dispatched an installer) and pass on this branch; the rendered Updates dialog covers legacy device, capable + available, capable + idle with the legacy Check then Update flow (installs once, no "nothing to install" refusal), double click, scoped refusals, retry after a failed read.
  • bun run lint (Biome + svelte-check) and the full frontend suite (435 files / 7275 tests) pass.
  • Board re-drill (OPI and Rock) on the package built from the merged head: phase available must go scoped, phase idle must go startUpdate.

Risks

  • Known non-package phases keep the legacy install route exactly as on main (no orchestrator admission, cellular gating or quarantine ownership). Making the Packages Check go through system.checkUpdatesNow so the tracked route covers idle is a deliberate follow-up, not part of this change.
  • A greyed Update with no warning band after a dropped connection: close and reopen Software Updates, or reload the page. A stale browser tab against a pre-orchestrator backend: reload.
  • User docs (EN + es-419) get one line about the dimmed button in the release docs PR.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0954b72f-4d40-4dd7-9529-0a348d4edf39

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@andrescera
andrescera merged commit 6442b72 into main Oct 23, 2026
18 checks passed
@andrescera
andrescera deleted the fix/packages-button-no-legacy-fallback branch October 24, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant