Skip to content

Bug Report: Offline Audio Does Not Auto-Sync When Internet Returns Unless Bluetooth Reconnects #7373

Closed

Description

@hugoaap-code

Bug Report: Offline Audio Does Not Auto-Sync When Internet Returns Unless Bluetooth Reconnects

Summary

When the Omi device remains connected via Bluetooth but the phone temporarily loses internet connection, the app appears to continue recording audio offline. However, when internet connectivity returns, the app does not automatically detect and synchronize the pending offline audio.

The offline audio only starts syncing after manually disconnecting and reconnecting the Omi device over Bluetooth.

Expected Behavior

If the app detects that offline audio exists and internet connectivity is restored, it should automatically start syncing pending offline audio, even if the Bluetooth connection was never interrupted.

The sync process should not depend only on a Bluetooth reconnection event.

Actual Behavior

When internet is lost while the Omi device remains connected through Bluetooth:

  1. The device/app appears to continue recording offline audio.
  2. Internet connection later returns.
  3. The app does not automatically sync the pending offline audio.
  4. The audio remains pending.
  5. If the user disconnects Bluetooth and reconnects the Omi device, the app then detects the offline audio and starts syncing.

Steps to Reproduce

  1. Connect the Omi device to the mobile app via Bluetooth.
  2. Make sure the phone has internet access.
  3. Start using the device normally.
  4. Temporarily lose internet while Bluetooth remains connected.
    • Example: enter an elevator, lose mobile data/Wi-Fi, or simulate network loss.
  5. Keep the Omi device connected via Bluetooth during the internet outage.
  6. Wait while the device/app records audio offline.
  7. Restore internet connection without disconnecting Bluetooth.
  8. Observe whether the app automatically syncs the pending offline audio.
  9. Disconnect and reconnect the Omi device via Bluetooth.
  10. Observe that the app then starts syncing the pending offline audio.

Observed Result

The app does not automatically start sync when internet connectivity is restored if the Bluetooth connection stayed active the whole time.

Sync starts only after a Bluetooth reconnect event.

Expected Result

The app should automatically check for and sync pending offline audio when internet connectivity is restored, regardless of whether the Bluetooth connection changed.

Why This Matters

This creates a risk that users may believe their offline recordings are being synced after internet returns, but the audio remains pending indefinitely unless they manually reconnect the device.

This is especially problematic in common real-world scenarios such as:

  • Entering and leaving elevators
  • Temporary mobile signal loss
  • Switching between Wi-Fi and mobile data
  • Short network outages
  • Areas with unstable internet but stable Bluetooth connection

Possible Root Cause

Based on the current behavior, the app seems to trigger offline audio detection mainly when the Bluetooth device connects or reconnects.

If the Bluetooth connection remains active, the app may not re-run the offline file detection logic when network connectivity returns.

There may be no independent trigger such as:

  • Connectivity restored event
  • Periodic offline file check
  • Pending WAL/offline audio watcher
  • App foreground/resume check
  • Retry scheduler for failed or pending offline sync

Suggested Fix

Add an additional offline sync trigger that is independent of Bluetooth reconnection.

For example, the app could check for pending offline audio when:

  1. Internet connectivity is restored.
  2. The app returns to foreground.
  3. A previous sync attempt failed because of no internet.
  4. A periodic background/foreground timer detects pending offline files.
  5. The device is still connected and reports offline files available.

Suggested logic:

On network restored:
if device is connected:
check device storage/offline file stats
if pending offline files exist and sync is not running:
start sync

also check local WALs/pending phone files:
if pending files exist and sync is not running:
start upload

Suggested Acceptance Criteria

  • If internet is lost while Bluetooth stays connected, offline recording continues.
  • When internet returns, the app automatically detects pending offline audio.
  • Sync starts without requiring Bluetooth disconnect/reconnect.
  • Pending offline audio does not remain stuck indefinitely.
  • The app should retry safely if sync fails due to temporary network issues.
  • The user should not need to manually reconnect the device to trigger sync.

Environment

  • App: Omi mobile app
  • Device: Omi device connected via Bluetooth
  • Platform: Mobile app
  • Network condition: Temporary internet loss while Bluetooth remains connected
  • Bluetooth status: Stays connected during the network outage

Impact

Medium to high.

This affects reliability of offline recording and sync. Users may lose trust in the app if offline recordings appear to be captured but do not sync automatically when internet returns.

Activity

  1. added
    bug
    p2
    capture
    and removed
    p2
    on May 23, 2026
  2. aryanorastar commented on Aug 6, 2026

    @aryanorastar
    Collaborator

    Status check (2026-08-06) — COVERED on main

    Verified before picking this up:

    The exact repro (internet returns while BLE stays connected → pending offline audio should sync without a Bluetooth reconnect) is fixed by merged #9763 (RecordingTransferCoordinator + WakeTrigger.connectivityRestored).

    Evidence on main:

    • Connectivity restore wakes the coordinator without a BLE event (recording_transfer_coordinator.dart → wake(WakeTrigger.connectivityRestored))
    • Discover/drain still pulls device offline files over BLE when needed
    • Hermetic regression: connectivity restoration drains without a Bluetooth event (#7373) in recording_transfer_coordinator_test.dart

    Not the same bug: #11084 / #7194 — preserve on-device offline batch across BLE disconnect (orthogonal).

    Intentional limit (separate issue): connectivity wakes are foreground-scoped; background restore is #7221 / #11127.

    Recommend closing this issue as fixed by #9763. No new PR planned from me.

  3. undivisible commented on Aug 20, 2026

    @undivisible
    Collaborator

    Closing per automated triage (2026-08-20): verified fixed: #9763 centralizes recording sync recovery. See /tmp/omi-issue-triage.md.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcapturep2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions