Repository navigation
fix(app): block pendant firmware updates on an unknown battery - #24434
Git-on-my-level wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 106 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
) <!-- claude-projects-attribution: {"github_login":"Git-on-my-level"} --> _Requested by **David**_ ## What changed and why `plans_sheet_cancel_pending_test.dart` pinned the subscription period end to 2026-11-03 00:00 UTC. That instant has now passed, so the sheet no longer shows "Your Plus plan ends …" and `resubscribe uses the current price and replaces the ends line` fails on every app PR that runs the full Flutter suite (for example #24434). The test now uses 2099-11-03, so the period never ends during a run. Only the test changes. ## Product invariants affected None. Test-only change. ## How it was verified Ran the file locally with `flutter test app/test/widgets/plans_sheet_cancel_pending_test.dart`. ## Tests The existing tests in that file, unchanged except for the date. ## Failure class Failure-Class: none ## UI evidence UI-Evidence: none -- test-only change 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/24472?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24472?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24472&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
|
/approve-ui 51df326 |
|
David signed off this UI in Telegram on 2026-11-04. The CI check still needs kodjima33 to comment |
|
Refreshing the UI approval check. kodjima33 already approved this head. |
|
Folded into the survivor #24485 (head What carried over: the whole firmware-battery lane — One adjustment: the PR's only |
|
Hey @Git-on-my-level 👋 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:
Before your next PR, please skim:
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! |
Requested by David
What changed and why
Pendant firmware updates require a current battery reading at or above the 30% threshold approved by David on 2026-11-03, or charging confirmed in the current connection session. Unknown and zero readings cannot bypass the gate. The gate controls update/retry actions, sheet confirmation, and the handoff after downloading.
Disconnect now clears the provider's cached battery to
-1and charging to false immediately, before the disconnect debounce. It also retires the battery/charging session and cancels its listeners; late reads and callbacks cannot restore the old state, even after the same pendant reconnects. A new device or account session also clears the reading. Reconnect waits for a fresh sample. Other battery readers already handle unknown readings or hide disconnected values.The BLE callback and the provider test seam now share the same throttling implementation. Crossing the firmware threshold in either direction always notifies, including 29%→30% and 30%→29%; a known-to-unknown change also notifies. Unrelated small changes retain the existing throttle. The battery threshold and decision now live together in a small shared utility so the provider and page use one threshold.
Unknown battery shows separate localized wait/reconnect guidance without a percentage. All supported locales were reviewed against the adjacent battery warning: Romanian, Hungarian, and Estonian needed informal singular, and were corrected through
python3 scripts/l10n.py set; the others match that warning or use neutral wording. The three changed locales have render evidence. The 30% minimum and adjacent guidance are translated across every locale; the checklist key is nowfirmwareBatteryRequirementso its name does not encode a percentage. All five comments in the supplied review file were verified and addressed.Product invariants affected
none
Existing mobile UX primitives, theme tokens, and localization rules remain in use. No product-invariant definition changes. David approved raising the firmware update minimum from 15% to 30% on 2026-11-03; charging still permits any level.
Line-Count-Exception: app/lib/providers/device_provider.dart | 1663 -> 1680 | Keep battery and charging session invalidation with the existing device lifecycle; share production/test throttling and publish safety-threshold crossings. Net growth is 17 lines.
How it was verified
Flutter 3.44.5 from PATH and the requested clang-format directory. Tests and preflights run through
/Users/dazheng/workspace/omi/bin/omi-heavy run --. All fixtures are hermetic; no real device, live backend, or GCP tier was used.The firmware page tests use the real DeviceProvider battery publication logic. The 2026-11-03 threshold follow-up passed 77 focused battery/provider/render tests in 14 seconds, including explicit 15% and 29% rejection, 30% admission, zero while charging, 29%↔30% provider publication, and sheet confirmation at the old minimum. Focused Flutter analysis passed with no issues, and
python3 scripts/l10n.py checkpassed key-set, placeholder and generated-freshness checks. All 49 locales use 30 in the three battery messages, preserving localized numerals;firmwareBatteryAbove15was replaced byfirmwareBatteryRequirementthrough the repository localization tool and generated output.All four evidence images were regenerated and are byte-for-byte unchanged because the unknown-battery guidance has no percentage. The English, Romanian, Hungarian and Estonian renders were visually inspected for readable copy and clipping. Existing image filenames and links remain unchanged for repointing after push.
OMI_PR_BODY_FILE=/Volumes/Ephemeral/scratch/cv1-lab/appgate/pr.md make preflightpassed all 27 checks in 56.38 seconds (exit 0), throughomi-heavy. Preflight retainedFailure-Class: noneand required no product-invariant citation. Logs use thebattery-30-prefix under/Volumes/Ephemeral/scratch/cv1-lab/appgate/. The finalscripts/pr-preflight --pr-body-filevalidation also passed all 27 checks in 75.60 seconds (exit 0). Follow-up commit:424535183d34d29cf42e31c9a4f004b50b6fed78(fix(app): require 30% battery for pendant firmware updates), appended afterb830acce8b37; no amend or push.Tests
cd app && flutter test --no-pub --timeout 90s --dart-define=FIRMWARE_BATTERY_RENDER_OUTPUT="$PWD/../.agent-artifacts/ui-evidence/firmware-battery-gate" test/unit/firmware_update_battery_test.dart test/providers/device_provider_test.dart test/providers/device_provider_fully_charged_alert_test.dart test/providers/device_provider_disconnect_telemetry_test.dart test/providers/device_provider_session_generation_test.dart test/widgets/firmware_update_battery_render_test.dart.cd app && python3 scripts/l10n.py check./Volumes/Ephemeral/scratch/cv1-lab/appgate/translation-voice-review.json.Failure class
Failure-Class: none
UI evidence
Captured with
flutter-render-evidence: real page, product fonts, synthetic data, iOS dark theme, 393 × 852 logical pixels at 3×. Screenshots and siblingevidence.jsonare tracked in.agent-artifacts/ui-evidence/firmware-battery-gate/.