owncloud / owncloud/android

[FEATURE REQUEST] Improve downloads behaviour, not depending on `Content-Length` header

Open
#4,417 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Estimation - 5 (L) Feature request Technical
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

It comes from https://github.com/owncloud/android/issues/4352#issuecomment-2124059223

this is the way to do, following the line of iOS app:

By sending the Etag for the file from the last PROPFIND as If-Match header, the app can ensure it gets either:

  • the version of the file whose metadata the app already has (=> which also means the size of the file is what the PROPFIND returned)
  • or: a 412 status response indicating the file has changed in the meantime, so a PROPFIND on the file can be sent to update the metadata for the file and a download subsequently be re-attempted

Receiving a newer/different version of the file than what the last PROPFIND returned wouldn't be good for several reasons:

  • the checksum verification (if one was provided by the server) would fail, which would make the app determine the file contents was not properly or fully received, and result in the app discarding the file it just downloaded
  • the Etag would change for the file with the next PROPFIND (f.ex. while discovering changes), from the outdated one (at the time of download) to the actual one (for the file that was already downloaded). This would result in the app discarding the file it just downloaded - because it has to assume the file is has downloaded is a different version than the file on the server, due to the Etag change.
TASKS
  • Research (if needed)
  • Create branch feature/feature_name
  • Development tasks
    • Implement whatever
    • ...
    • Implement unit tests (if needed)
  • Code review and apply changes requested
  • Design test plan
  • QA
  • Merge branch feature/feature_name into master

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked owncloud/android issue comment first, then trace the Android download flow and the PROPFIND metadata handling. The change is complete when downloads use the previously returned Etag with If-Match, handle a 412 by refreshing metadata and retrying, and preserve checksum and Etag consistency.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.