Repository navigation
Conversation
…ardware#4822) Implements automatic offline batch upload resumption upon stable network connection with failsafe file preservation, ensuring that offline/batch recordings captured on Android and mobile devices are reliably drained without data loss or permanent retry lockouts. Closes BasedHardware#4822 Failure-Class: none PayPal: [email protected]
|
Thanks @TheRWX — this addresses the core of #4822 (drain offline batch recordings once connectivity returns, without data loss), and it reuses the right primitives rather than inventing new ones. I reviewed all four changed files against main. app/lib/utils/batch_recording.dart
app/lib/providers/local_recordings_provider.dart
app/test/unit/local_recordings_auto_upload_test.dart
app/lib/pages/conversations/recording_detail/recording_detail_sheet.dart
One product question for maintainers: the issue asks for uploads on a "stable" network. Nice work keeping the change tight and reusing — by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (automatic offline batch upload resumption) — approve only per policy; DIRTY, needs-tests label.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (auto-resume offline batch uploads on reconnect) — approve-only per policy.
kodjima33
left a comment
There was a problem hiding this comment.
Feature-shaped implementation (titled feat, new auto-resume capability) referencing #4822; ambiguous bug/feature treated as feature per policy default — approve-only. needs-tests label, mergeStateStatus DIRTY, not merging.
|
Thanks for the approval. This branch now conflicts with |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (automatic offline batch upload resumption) — approve-only per policy; DIRTY so not mergeable regardless.
Summary
Fixes #4822
Implements automatic offline batch upload resumption upon stable network connection with failsafe file preservation, ensuring that offline/batch recordings captured on Android and mobile devices are reliably drained without data loss or permanent retry lockouts.
Key Changes
canAutoUploadPhoneRecordingsinapp/lib/utils/batch_recording.dartwithhasNetworkgating, ensuring automatic upload attempts only begin when active network connectivity is established.ConnectivityService().isConnectedcheck inLocalRecordingsProvider._maybeAutoUpload()to avoid attempting uploads into disconnected networks.LocalUploadOutcome.networkDisconnectedtoLocalUploadOutcomeinapp/lib/providers/local_recordings_provider.dart._uploadFileto catch transient network failures (isTransientNetworkError(e)) and classify them asnetworkDisconnected._recordUploadOutcome: transient network drops preserve the file on disk without incrementing the permanent per-file failure cap (autoPhoneUploadMaxFailures).recording_detail_sheet.dartto handleLocalUploadOutcome.networkDisconnectedwithnoInternetConnectionuser feedback._onNetworkRestored()inLocalRecordingsProvidertriggered byConnectivityService().onConnectionChange.connected == true), clears transient failure backoff (_autoFailures.clear()) and triggers_maybeAutoUpload()to automatically drain queued recordings.resetAutoPhoneUploadFailures()inbatch_recording.dartto support deterministic reset across test and runtime surfaces.result.completed != nullor reconciler jobcompleted).app/test/unit/local_recordings_auto_upload_test.dartforhasNetworkgating, failure reset on reconnect, and sequential disconnect-then-reconnect simulation with failsafe file preservation.Verification & Testing
test/unit/local_recordings_auto_upload_test.dart):canAutoUploadPhoneRecordings blocks when hasNetwork is false: PASSEDcanAutoUploadPhoneRecordings allows when hasNetwork is true: PASSEDresetAutoPhoneUploadFailures clears all failure counts to restore eligibility: PASSEDnetwork restoration and failsafe batch upload simulation: transient disconnect preserves file and reconnect drains preserved files: PASSEDlocal_recordings_auto_upload_test.dart: PASSEDtest/unit/local_recordings_owner_test.dart: 5/5 PASSEDtest/services/wals/recording_transfer_coordinator_test.dart: 21/21 PASSEDdart analyze: No issues found (0 errors).dart format: 0 changed.Failure-Class: none
PayPal: [email protected]