feat(app): add offline-recordings auto-sync toggle to device settings#7707
feat(app): add offline-recordings auto-sync toggle to device settings#7707mdmohsin7 wants to merge 8 commits into
Conversation
Adds the autoSync title and autoSyncDescription subtitle strings used by the new offline-recordings auto-sync toggle in device settings.
Stores the user's choice to auto-sync offline recordings to Omi when the device connects. Defaults to true so existing behavior is unchanged.
Skip post-session auto-sync and startup orphan-WAL recovery when the user has turned auto-sync off. Manual sync is unaffected.
Honors the autoSyncOfflineRecordings preference in the in-provider auto-upload path.
Respects the autoSyncOfflineRecordings preference at the home-page offline-data-detected entry point.
Adds a switch under Offline Sync, shown only for Omi devices, that lets users enable or disable automatic syncing of offline recordings. Extends the settings row helper to support a subtitle and trailing widget.
|
@greptile-apps review |
Greptile SummaryThis PR adds an Auto-Sync toggle to device settings that lets users opt out of having offline recordings automatically synced to Omi when the device connects. The preference defaults to
Confidence Score: 3/5Safe to merge for single-device users (the majority), but multi-device users pairing an Omi with a friendPendant or openglass could have auto-sync permanently blocked with no UI recourse. All four auto-sync entry points are guarded by a global autoSyncOfflineRecordings flag, but the UI to flip that flag is gated exclusively to DeviceType.omi. The PR notes that friendPendant and openglass also support WAL sync — so a user who disables the toggle on their Omi and then connects one of those devices will silently lose auto-sync on it with no way to re-enable it from the UI. The default is true so the happy path is unaffected, but the cross-device state bleed is a real breakage for the multi-device minority. app/lib/providers/capture_provider.dart and app/lib/providers/sync_provider.dart — the preference guards need a device-type condition (or the preference needs to be scoped per device type) to avoid silently disabling auto-sync on non-Omi WAL devices. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Device Connects / Offline Data Detected] --> B{useCustomStt?}
B -- Yes --> C[Skip auto-sync\nManual only]
B -- No --> D{autoSyncOfflineRecordings?}
D -- false --> E[Skip auto-sync\nUser opt-out]
D -- true --> F[Proceed with auto-sync]
F --> G[_autoSyncSessionWals\ncapture_provider]
F --> H[recoverOrphanedWals\ncapture_provider]
F --> I[_autoUploadPendingPhoneFiles\nsync_provider]
F --> J[onOfflineDataDetected\nhome/page]
K[Device Settings UI\nDeviceType.omi only] -->|writes| L[(SharedPreferences\nautoSyncOfflineRecordings)]
L -->|read by| D
style C fill:#555,color:#fff
style E fill:#555,color:#fff
style K fill:#8B5CF6,color:#fff
Reviews (1): Last reviewed commit: "feat(app): add Auto-Sync toggle to devic..." | Re-trigger Greptile |
| if (!SharedPreferencesUtil().autoSyncOfflineRecordings) { | ||
| Logger.debug('Orphan WAL recovery skipped: auto-sync disabled by user'); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Global preference silently disables sync for non-Omi WAL devices
The autoSyncOfflineRecordings preference is checked unconditionally in all four auto-sync paths (_autoSyncSessionWals, recoverOrphanedWals, _autoUploadPendingPhoneFiles, and the home/page callback), but the UI toggle to control it is shown only for DeviceType.omi. Since friendPendant and openglass also support WAL sync (as noted in the PR description), a user who sets their Omi to off will have auto-sync silently disabled for any non-Omi WAL device they also use — with no UI control to restore it on that device. Each provider check would need to also gate on the connected device's type, or the preference should be per-device-type to avoid this cross-device bleed.
There was a problem hiding this comment.
Auto-sync of offline recordings is an Omi-only feature — no other device type (openglass, friendPendant, etc.) auto-syncs — so the global autoSyncOfflineRecordings preference can't disable sync on a non-Omi device, and the Omi-only toggle is the correct and only control surface. No cross-device bleed in practice. Resolving as non-issue.
What
Adds a Auto-Sync toggle in device settings that lets users enable or disable automatic syncing of offline recordings to Omi. Shown only for Omi devices (
DeviceType.omi). Defaults to on.Why
#7691 stopped auto-syncing offline recordings for custom-STT users (those files can only be transcribed on Omi's servers, counting toward their limit). This adds explicit user control of the same automatic behavior for everyone else: some users prefer to back up offline recordings manually rather than have them auto-sync and transcribe on connect.
Default is
trueso existing behavior is unchanged — the toggle is opt-out, introduced alongside the feature.How
backend/preferences.dart): newautoSyncOfflineRecordingsbool,getBooldefaulttrue.useCustomSttexemption, covering all four automatic entry points:capture_provider._autoSyncSessionWals(post-session)capture_provider.recoverOrphanedWals(startup/reconnect recovery)sync_provider._autoUploadPendingPhoneFiles(in-provider auto-upload)home/pageoffline-data-detected triggersettings/device_settings.dart): aSwitchrow under "Offline Sync", gated toDeviceType.omi. The shared row helper_buildProfileStyleItemgains optionalsubtitleandtrailingparameters.autoSync+autoSyncDescriptionadded to the template and translated across all 48 non-English locales;flutter gen-l10nreports zero untranslated.Verification
capture_providertest suite passes.flutter gen-l10n— zero untranslated messages.Notes
DeviceType.omionly, not the wider Omi family (openglass/friendPendant) which also support WAL sync.