Skip to content

fix(firmware): surface version check failure instead of masking as up to date (#25375) - #25532

Closed
TassioSales wants to merge 3 commits into
BasedHardware:mainfrom
TassioSales:fix/firmware-lookup-error-masked-25375
Closed

TassioSales wants to merge 3 commits into
BasedHardware:mainfrom
TassioSales:fix/firmware-lookup-error-masked-25375

Conversation

@TassioSales

@TassioSales TassioSales commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #25375 by ensuring firmware lookup failures and unavailable release metadata are surfaced with an explicit status message and retry action, rather than falsely displaying "Your device is up to date".

Problem

When getLatestFirmwareVersion returns an empty map {} (e.g. non-200 HTTP response or network failure), DeviceUtils.shouldUpdateFirmware returns ('Latest Version Not Available', false, '').
FirmwareUpdate previously checked only !shouldUpdate to render context.l10n.yourDeviceIsUpToDate with a green checkmark, masking the lookup failure from the user and preventing recovery.

Changes

  1. Differentiate True Up-to-date vs Lookup Failure:
    • Checked hasLatestVersion (latestFirmwareDetails.isNotEmpty && latestFirmwareDetails['version'] != null).
    • If lookup failed / unavailable, displays updateMessage with FontAwesomeIcons.circleExclamation and OmiColors.warning.
    • If truly up to date, displays context.l10n.yourDeviceIsUpToDate with FontAwesomeIcons.circleCheck in OmiColors.success and displays both the current and latest versions.
  2. Added Retry Check Action:
    • Extracted _checkVersion() method.
    • When a lookup failure occurs, provides an inline "Try Again" OmiButton so the user can re-check firmware without navigating away.

View guided diff

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the production change is correct and nicely scoped — it fixes the core bug from #25375 (a failed firmware lookup rendered as "Your device is up to date"), and I verified the supporting pieces. No blockers; follow-up notes below.

What I verified in app/lib/pages/home/firmware_update.dart:

  • _checkVersion() extraction from initState: identical getStableVersion / getLatestVersion -> shouldUpdateFirmware sequence and mounted-guarded setState as before — behavior-preserving, now reusable for the retry action.
  • Status row: when the lookup yields no version, updateMessage renders in OmiColors.warning with a circleExclamation icon instead of the false green up-to-date check. I confirmed shouldUpdateFirmware (app/lib/utils/device.dart) returns a non-empty message on the empty-metadata path that caused Android CV1 3.0.21 shown as up-to-date despite published 3.0.24 (firmware lookup error masked) #25375, so the reported symptom is genuinely fixed.
  • Version card: the latest-version row now also shows when the device is already current (hasLatestVersion), giving a current-vs-latest comparison; the nullable chipColor matches the existing current-version row pattern.
  • Retry button: OmiButton(leading/expand), context.l10n.tryAgain, and OmiColors.warning all already exist in the codebase (used in omi_partial_notice.dart and developer_firmware_flash_page.dart), so no new dependencies.

Follow-ups (non-blocking):

  • The fallback string 'Unable to check for firmware updates' (~line 342) is hardcoded English — consistent with the pre-existing hardcoded strings returned by device.dart, but ideally both move to l10n in a follow-up.
  • One residual mask remains: when firmware metadata is present but the installed app is too old for it, shouldUpdateFirmware returns (message, false, version) with version set — hasLatestVersion is then true and the UI still shows "up to date" instead of the incompatibility message. Pre-existing behavior; worth a follow-up issue.
  • The new failure state has no widget test; the Key('firmware_update_retry_check') you added makes that easy — a test driving _checkVersion with an empty lookup result and asserting the warning row plus retry button would lock this fix in.

USER IMPACT: when the firmware check fails, users now see an explicit warning with a Try Again button instead of a false "Your device is up to date" — and when genuinely up to date, they also see the latest available version for comparison.

Nice first contribution — clear problem write-up and a scoped fix. Nothing blocking from my side; formal approval left to a human maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Nov 16, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Since my last review: addressed (the sync with current main is resolved correctly — bfbc59a adopts upstream's rewritten rollback-branch logic verbatim inside _checkVersion, and the fix's status-row/retry changes rebase on top unchanged) · still open (hardcoded fallback string 'Unable to check for firmware updates'; no widget test for the failure state; pre-existing mask when metadata exists but the installed app is too old for it) · newly introduced (none).

Verdict: still a correct, well-scoped fix for #25375 — it survives the merge with main intact, and nothing new is blocking.

What I verified on the new head:

  • The rollback branch in _checkVersion() is byte-identical to main's current initState logic, so the conflict resolution introduces no behavior drift.
  • The status row still gates on hasLatestVersion: a failed lookup now renders updateMessage in OmiColors.warning with a circleExclamation icon instead of the false green "up to date" check, and a genuine up-to-date result shows current vs latest versions.
  • context.l10n.tryAgain is confirmed present in the app/lib/l10n ARB catalogs at this head; the retry button (firmware_update_retry_check) correctly re-runs _checkVersion.

USER IMPACT: unchanged from my earlier note — when the firmware check fails, users now see an explicit warning with a Try Again button instead of a false "Your device is up to date"; when genuinely current, they also see the latest available version for comparison.

Still nice-to-have before merge (non-blocking): a widget test driving _checkVersion to an empty lookup result and asserting the warning row plus the retry button — the Key you added makes this straightforward.

Formal approval left to a human maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing as superseded by main's #25757 and merged #25455 (17c2743efc8f66ec11ec513a32c9e38c3f88b81f). Together they cover failed checks and retry, invalid release metadata, unreadable revisions, firmware/app prerequisites and unusable rollback metadata. The final source passed 10,106 CI tests and the focused/live verification documented in #25455. This branch conflicts with main and its proposed lookup-error handling is already covered; its branch and commit history are preserved.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @TassioSales 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android CV1 3.0.21 shown as up-to-date despite published 3.0.24 (firmware lookup error masked)

3 participants