fix(updates): a failed update check is not 'You're up to date' #79

Merged
Breadway merged 2 commits from fix/bset-71-update-check-failed into main 2026-10-14 13:54:16 +08:00
Owner

Closes BSET-71

What

  • The Updates hero picked its state from total === 0 alone. When the pacman or bakery check errored (no network, missing sync db, mirror down, lock held), it showed a green tick and "You're up to date" directly above "Couldn't check system updates". It now uses heroState() ($lib/updateHero.ts):
    • failed: a check errored and no updates are known. The hero shows an alert icon, "Couldn't check for updates", which parts failed, and Check again.
    • ready: updates are known to be pending. These are still offered even if the other check failed.
    • current: only when both checks succeeded with nothing pending.
  • Firmware: "Install firmware updates" is hidden when fwupd lists no updatable device. Secure Boot lists count as updatable.

Tests

  • updateHero.test.mjs (added to npm test) covers checking, updating, current, failed per source, ready with a partial failure, and the failed-parts text.
  • On top of current main: svelte-check 0/0, npm test, build, cargo fmt, clippy -D warnings, cargo test (179).

Capability changes

None removed. The Firmware install button now only appears when there is something it can install.

Closes BSET-71 ## What - The Updates hero picked its state from `total === 0` alone. When the pacman or bakery check errored (no network, missing sync db, mirror down, lock held), it showed a green tick and "You're up to date" directly above "Couldn't check system updates". It now uses `heroState()` (`$lib/updateHero.ts`): - **failed:** a check errored and no updates are known. The hero shows an alert icon, "Couldn't check for updates", which parts failed, and Check again. - **ready:** updates are known to be pending. These are still offered even if the other check failed. - **current:** only when both checks succeeded with nothing pending. - Firmware: "Install firmware updates" is hidden when fwupd lists no updatable device. Secure Boot lists count as updatable. ## Tests - `updateHero.test.mjs` (added to npm test) covers checking, updating, current, failed per source, ready with a partial failure, and the failed-parts text. - On top of current main: svelte-check 0/0, npm test, build, cargo fmt, clippy -D warnings, cargo test (179). ## Capability changes None removed. The Firmware install button now only appears when there is something it can install.
fix(updates): a failed update check is not 'You're up to date'
All checks were successful
check / check (push) Successful in 5m0s
6326c77a1d
The hero chose its state from the update count alone, so a pacman or bakery
check that errored (no network, missing sync db, mirror down) showed a green
tick and 'System and bread apps are current' above the error. heroState()
now returns failed when a check errored and nothing is known to be pending;
the hero says Couldn't check for updates with Check again.

Firmware hides Install firmware updates when fwupd lists no updatable
device, instead of offering a primary action with nothing to install.
Merge remote-tracking branch 'origin/main' into fix/bset-71-update-check-failed
All checks were successful
check / check (push) Successful in 5m43s
a0ae30a1fd
# Conflicts:
#	frontend/package.json
Author
Owner

Review verdict: PASS for exact head a0ae30a1fd (base main d432319).

Criteria:

  • Check error with nothing pending is not "You're up to date": heroState() returns failed (updateHero.ts); Updates.svelte shows alert icon, "Couldn't check for updates" and which parts failed. Tested per source in updateHero.test.mjs.
  • Check again stays visible whenever status is loaded and not busy; error details remain in the "What will update" group (pacman_error / bakery_error messages unchanged).
  • Known pending updates still offered when the other check failed: heroState returns ready when pending > 0; Update everything gated on total > 0. Tested.
  • current only when both checks succeeded and nothing pending. Tested.
  • Firmware: "Install firmware updates" only rendered when devices?.length; Secure Boot lists count as updatable.
  • No regressions: Update everything, per-part updates, recheck and progress code paths untouched.
  • Merge of main: package.json test script keeps every main test file (keycapture, nightlight, liveGate, snapshotRestore, snapshotLabel, uniqueBy, displayLayout, v2, drafts, confirm) plus updateHero; all ran.

Verified in a clean detached worktree on the exact head:

  • frontend: npm ci, npm run check (0 errors, 0 warnings), npm test (all pass), npm run build OK.
  • src: cargo fmt --check clean, cargo clippy --locked --all-targets -D warnings clean, cargo test --locked 179 passed.
  • Forgejo CI "check / check (push)" success on the exact head. No existing reviews. Mergeable.

Merging with a merge commit.

Review verdict: PASS for exact head a0ae30a1fd9f2f02df49f3e12b9471dcb43cb9c2 (base main d432319). Criteria: - Check error with nothing pending is not "You're up to date": heroState() returns failed (updateHero.ts); Updates.svelte shows alert icon, "Couldn't check for updates" and which parts failed. Tested per source in updateHero.test.mjs. - Check again stays visible whenever status is loaded and not busy; error details remain in the "What will update" group (pacman_error / bakery_error messages unchanged). - Known pending updates still offered when the other check failed: heroState returns ready when pending > 0; Update everything gated on total > 0. Tested. - current only when both checks succeeded and nothing pending. Tested. - Firmware: "Install firmware updates" only rendered when devices?.length; Secure Boot lists count as updatable. - No regressions: Update everything, per-part updates, recheck and progress code paths untouched. - Merge of main: package.json test script keeps every main test file (keycapture, nightlight, liveGate, snapshotRestore, snapshotLabel, uniqueBy, displayLayout, v2, drafts, confirm) plus updateHero; all ran. Verified in a clean detached worktree on the exact head: - frontend: npm ci, npm run check (0 errors, 0 warnings), npm test (all pass), npm run build OK. - src: cargo fmt --check clean, cargo clippy --locked --all-targets -D warnings clean, cargo test --locked 179 passed. - Forgejo CI "check / check (push)" success on the exact head. No existing reviews. Mergeable. Merging with a merge commit.
Author
Owner

Merged with a merge commit: 44cf2f1555. BSET-71 awaits coordinator verification of the integrated behavior; not marked done.

Merged with a merge commit: 44cf2f15556b70aa64dd8573f67117dc533368e8. BSET-71 awaits coordinator verification of the integrated behavior; not marked done.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos-settings!79
No description provided.