Skip to content

[MEDIA-018] Media backup recovery and retry #78

Description

@veryCrunchy

Roadmap

  • Task ID: MEDIA-018
  • Priority: P0
  • Depends on: MEDIA-003

Problem

Media uploads must recover safely from interruptions and timeouts without duplicating remote files or losing durable attempt history. On the latest successfully installable Android nightly, automatic retry and attempt tracking work, but the current single-request WebDAV upload path cannot reliably complete large media within Android background execution limits.

Acceptance criteria

  • Large uploads use the verified Nextcloud chunked-upload v2 protocol and resume from authoritative server chunk state after a timeout, process death, or WorkManager restart.
  • Interrupted or timed-out uploads resume or safely restart according to verified server state and idempotency rules.
  • Durable upload session IDs, receipts, attempt counts, last progress, source identity, destination identity, and failure classification survive process death.
  • Timeout values distinguish connection, response, idle-stream, and total-operation limits and are appropriate for large media on slow or variable networks.
  • Upload streaming never buffers the complete media file and reports bounded progress without excessive database writes or recomposition.
  • Retry does not duplicate a file when the previous result is ambiguous; authoritative remote state is checked before another non-idempotent transfer.
  • Final completion verifies the exact remote byte size before marking the transfer successful.
  • Failure details explain the safe next action without exposing credentials, raw server responses, or internal IDs.
  • Focused tests cover multi-gigabyte sparse fixtures, slow streams, stalled streams, network handoff, cancellation, ambiguous completion, retry attempt persistence, resumable chunks, and eventual success.
  • Physical-device validation records file-size class, network conditions, timeout class, and retry outcome using privacy-safe synthetic media.

Current evidence

On the latest successfully installed signed nightly, smaller timed-out media uploads automatically retried, displayed attempt 2, and eventually completed. A roughly 3 GB MP4 timed out on three consecutive attempts and remained unresolved. This confirms recovery scheduling works but also confirms that retrying the same monolithic upload cannot make large transfers reliable.

Activity

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

    area:mediaMedia backup, MediaStore, storage reclaim, and sharingplatform:androidAndroid-specific implementation or validationpriority:P0Required for a trustworthy mobile replacement or prevents data losstype:featureNew product capability

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions