Skip to content

fix(app): distinguish disconnected/pending device state in Offline Sync and update 48 locales (#24715) - #24818

Closed
cocvn157 wants to merge 2 commits into
BasedHardware:mainfrom
cocvn157:fix/offline-sync-disconnected-cv1-warning-24715
Closed

cocvn157 wants to merge 2 commits into
BasedHardware:mainfrom
cocvn157:fix/offline-sync-disconnected-cv1-warning-24715

Conversation

@cocvn157

@cocvn157 cocvn157 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #24715

UI-Evidence: none -- fixes disconnected and pending storage capability dialog gating in Offline Sync and updates 48 non-English locale strings without visual layout changes

Product invariants affected

  • INV-CAP-1

Root Cause

  1. DeviceProvider.setisDeviceStorageSupport() stored storage capability as a single boolean (isDeviceStorageSupport), collapsing three distinct states into false:
    • no device currently connected (connectedDevice == null),
    • storage capability read still pending or failed (getStorageList() error or empty read on a CV1 / storage-capable device), and
    • a connected device that genuinely lacks on-device storage.
  2. Both DeviceSettings._openOfflineSync and openOfflineSyncDetails checked !isDeviceStorageSupport and immediately showed v2Undetected / v2UndetectedMessage, telling users with a disconnected CV1 that their hardware did not support Offline Sync.
  3. While app_en.arb had updated v2Undetected and v2UndetectedMessage copy from #14510, all 48 non-English app_*.arb files and generated app_localizations_*.dart files still contained the legacy V1/V2 hardware generation wording.

Changes

  • app/lib/services/devices/connectors/device_connection.dart & omi_connection.dart:
    • Track lastStorageListReadFailed when reading the storage characteristic throws or fails and expose advertisesStorageCharacteristic.
  • app/lib/providers/device_provider.dart:
    • Introduce DeviceStorageCapability { disconnected, checking, supported, unsupported } alongside isDeviceStorageSupport.
    • Distinguish disconnected devices (disconnected), pending or failed capability reads on storage-capable/CV1 devices (checking), confirmed storage support (supported), and connected devices without storage support (unsupported).
  • app/lib/pages/conversations/sync_pending_work.dart & app/lib/pages/settings/device_settings.dart:
    • Add shared openOfflineSyncForDevice helper used by both DeviceSettings and openOfflineSyncDetails:
      • When disconnected, show connect/reconnect guidance (deviceNotConnected + deviceDisconnectedNotificationBody with reconnect action when a paired device is remembered, or connectDeviceMessage otherwise).
      • When checking, re-probe setisDeviceStorageSupport() once automatically; if still unresolved, show a retry dialog (activityAttentionStorageUnknownTitle + anErrorOccurredTryAgain + tryAgain) instead of claiming hardware lack of support.
      • When unsupported, show v2Undetected / v2UndetectedMessage.
      • When supported, route to AutoSyncPage / SyncPage.
  • app/lib/l10n/app_*.arb & app/lib/l10n/app_localizations_*.dart (48 locales):
    • Update v2Undetected and v2UndetectedMessage across all 48 non-English locales to match the capability-based English copy without V1/V2 hardware claims.
  • app/test/widgets/offline_sync_device_gate_test.dart & app/changelog/unreleased/fix-offline-sync-disconnected-device-warning.json:
    • Add unit and widget tests covering capability classification, disconnected paired CV1 reconnect dialog (in English and German), unconnected device prompt, pending capability retry flow, unsupported device alert, openOfflineSyncDetails gating, and all 49 locales' v2Undetected/v2UndetectedMessage strings.

Verification

  • python app/scripts/l10n.py check (ok: 49 locales, 4476 keys)
  • .github/scripts/check-mobile-changelog.py
  • .github/scripts/check_product_file_line_count_ratchet.py
  • .github/scripts/check_diff_hygiene.py
  • .github/scripts/check_product_invariants.py
  • .github/scripts/check_ui_evidence.py

View guided diff

@cocvn157
cocvn157 requested a review from mdmohsin7 as a code owner November 7, 2026 03:53

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 103 files

Confidence score: 5/5

  • The release note in fix-offline-sync-disconnected-device-warning.json may not clearly describe the user-visible outcome. Rewrite it around the misleading warning users will no longer see.
  • offline_sync_device_gate_test.dart implies English coverage, but only tests German. Add an English run or rename the test to avoid overstating coverage.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/test/widgets/offline_sync_device_gate_test.dart">

<violation number="1" location="app/test/widgets/offline_sync_device_gate_test.dart:275">
P3: This test name claims German and English coverage, but it only renders the German locale. Add an English run or rename the test so English gate regressions are not falsely implied to be covered.</violation>
</file>

<file name="app/changelog/unreleased/fix-offline-sync-disconnected-device-warning.json">

<violation number="1" location="app/changelog/unreleased/fix-offline-sync-disconnected-device-warning.json:2">
P3: Rewrite this release note around the user-visible outcome instead of hardware terminology and translation coverage. For example: `Offline Sync no longer shows a misleading unsupported-device warning while your paired Omi is disconnected or still checking, and its unavailable message is now translated consistently.`</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread app/lib/l10n/app_localizations_bn.dart Resolved
Comment thread app/lib/l10n/app_hi.arb Resolved
Comment thread app/lib/l10n/app_et.arb Resolved
Comment thread app/lib/l10n/app_bg.arb Resolved
Comment thread app/lib/l10n/app_localizations_he.dart Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member

The production change here is correct and nicely scoped — Offline Sync no longer tells users their hardware is unsupported when the real state is "disconnected" or "capability read still pending", and the dialog gate is now shared instead of duplicated. No blocking issues; details below.

Correctness

  • app/lib/providers/device_provider.dart — the new DeviceStorageCapability enum plus the storageCapability getter cleanly separates disconnected (no connectedDevice / not connecting), checking, supported, and unsupported. setisDeviceStorageSupport() now guards stale probes with the session-generation + device-id check, so a probe completing after a device swap no longer clobbers state, and the disconnect hooks reset the enum.
  • app/lib/services/devices/connectors/omi_connection.dart + device_connection.dart — _lastStorageListReadFailed is set on both the not-connected path and the read catch, reset at the start of performGetStorageList(); advertisesStorageCharacteristic (NativeBleTransport storage characteristic present) lets _probeStorageCapability distinguish "read failed" from "clean empty read". Empty read on a CV1/storage-advertising device maps to checking rather than a false unsupported — the right fail-safe.
  • app/lib/pages/conversations/sync_pending_work.dart — openOfflineSyncForDevice(): disconnected + remembered device shows a reconnect confirm that kicks scanAndConnectToDevice(); no remembered device shows connect guidance; checking re-probes once then offers a retry dialog (recursion only on user tap, so no unbounded loop); unsupported keeps the capability alert. openOfflineSyncDetails() now routes through the same gate instead of the old !isDeviceStorageSupport alert.
  • app/lib/pages/settings/device_settings.dart — _openOfflineSync delegates to the shared gate; duplicated alert and page imports removed. Good dedup.
  • app/test/widgets/offline_sync_device_gate_test.dart — 492 lines of real coverage: capability-classification unit tests (disconnected / supported / checking-on-failed-read / unsupported-on-clean-empty-read), gate widget tests in English and German, the openOfflineSyncDetails path, and a 49-locale invariant that no v2Undetected/v2UndetectedMessage string still contains V1/V2 wording.
  • The 48-locale .arb + generated app_localizations_*.dart wave is a faithful mechanical translation of the app_en.arb copy from fix(app): compose live-capture copy and states from active capabilities (#14473) #14510 (sampled de/es/fr/ru/ja/zh); keys unchanged.

Notes (non-blocking)

  • device_provider.dart carries ~15 unrelated single-line-collapse reformats (_bleDisconnectDevice, prepareDFU, firmware-prompt coordinator, battery listener). I checked them as behavior-preserving, but they add review churn — please keep fix diffs tight in future.
  • A persistently failing storage read on a real device now leaves the user in the retry dialog indefinitely with no path to an explanatory message; consider falling back to a "storage unavailable" explanation after a few failed retries.

UX: users with a disconnected or still-probing device get accurate connect/reconnect/retry prompts instead of a false "your device doesn't support this" alert with stale V1/V2 wording, in every supported locale.
Blast radius: Offline Sync entry points only (device settings + pending-work shortcut); no sync data paths, no backend, no protocol changes. Worst case if wrong is a wrong dialog choice, not data loss.
Performance: at most one extra BLE storage-list probe per gate open on the checking path — bounded and user-triggered.

USER IMPACT: with a disconnected Omi device, Offline Sync now asks you to reconnect instead of claiming your hardware is unsupported, and the stale V1/V2 warning text is replaced across all 48 non-English languages.

Still want as a reviewer: green CI on this head (no check runs are visible to me yet) and a quick manual pass on a storage-less device confirming the unsupported alert still appears.

Leaving the merge decision to a human maintainer: first substantial contribution on this surface, no CI results visible yet, and the CV1 capability heuristic encodes hardware assumptions worth a product-owner glance.


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 7, 2026
@cocvn157 cocvn157 closed this Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Hey @cocvn157 👋

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!

aryanorastar added a commit that referenced this pull request Nov 22, 2026
## What changed and why

Offline Sync now gives reconnect guidance for a disconnected wearable,
lets users retry an inconclusive storage check, and shows an unsupported
message only when the device's storage capability is established. Device
Settings and phone activity share the device entry rule. Phone-local
recordings remain accessible.

The connection owns one storage check at a time and retires it on link
loss. The localized unsupported message drops V1/V2 wording in all 48
affected locales. The translations come from cocvn157's [earlier PR
#24818](#24818).

Fixes #24715.

## Product invariants affected

- INV-CAP-1. The new check reads existing device status and controls
page entry. Recording, storage and deletion protocol behavior remains
the same.

Line-Count-Exception: app/lib/providers/device_provider.dart | 1746 ->
1765 | Own one storage capability result at the existing account and
connection reset points. Protocol proof and dialog behavior remain in
their current layers.

## How it was verified

- 67 focused Flutter tests passed. Tests tap the real Device Settings
Offline Sync row and On the Way details, verify English and German
guidance, exercise Cancel, retry and phone-local entry, and simulate the
native discovery and same-device reconnect state.
- Focused Dart analysis passed. Localization validation passed across 49
locales. English wording for unsupported hardware stays the same.
- All 31 seeded mobile journeys passed, including the capture reconnect
journey.
- The UI evidence uses the real Flutter widgets with synthetic
recordings and device state in an iOS-layout renderer.

## Tests

- `app/test/widgets/offline_sync_entry_test.dart` and
`app/test/widgets/device_settings_double_tap_test.dart`
- `app/test/unit/offline_storage_capability_test.dart` and
`app/test/providers/device_provider_test.dart`

## UI evidence

![German connect
guidance](https://raw.githubusercontent.com/BasedHardware/omi/3aaa4a80fafea4e9179fd0de2a8d3a032eaf47d0/.agent-artifacts/ui-evidence/24715-offline-sync-capability/001-mobile-ios-disconnected-de.png)
![English retry
prompt](https://raw.githubusercontent.com/BasedHardware/omi/3aaa4a80fafea4e9179fd0de2a8d3a032eaf47d0/.agent-artifacts/ui-evidence/24715-offline-sync-capability/002-mobile-ios-storage-check-en.png)
![German unsupported storage
message](https://raw.githubusercontent.com/BasedHardware/omi/3aaa4a80fafea4e9179fd0de2a8d3a032eaf47d0/.agent-artifacts/ui-evidence/24715-offline-sync-capability/003-mobile-ios-unsupported-de.png)

## Failure class

Failure-Class: none
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.

Offline Sync: disconnected CV1 triggers misleading V1/V2 warning; 48 locales retain old copy

2 participants