nextcloud / nextcloud/ios

Auto upload of photos happens twice or more often

Open
#1,265 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: auto upload
Dominant language
Swift
Stars
2.5k
Forks
1k
Avg merge
2d 18h
Merged PRs (30d)
13

Description

Expected behaviour
  • upload every photo exactly once
Actual behaviour
  • upload happens multiple times. Those are two files (the jpg and the mov) - both are uploaded 3 times each. The two first ones of each file succeed (and take ~2 seconds). Three requests get immediately a 423 file locked (because the upload is happening and the locking protected from concurrent access). The sixth request succeeds again and overwrites the file, because it happened after the first upload was done
192.168.1.1 mjob [06/May/2020:21:08:47 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.jpg HTTP/2.0" 201 608 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 1.950 1.950 .
192.168.1.1 mjob [06/May/2020:21:08:47 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.jpg HTTP/2.0" 423 644 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 0.311 0.311 .
192.168.1.1 mjob [06/May/2020:21:08:47 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.mov HTTP/2.0" 423 662 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 0.040 0.040 .
192.168.1.1 mjob [06/May/2020:21:08:48 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.mov HTTP/2.0" 423 662 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 0.040 0.040 .
192.168.1.1 mjob [06/May/2020:21:08:49 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.mov HTTP/2.0" 201 594 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 2.158 2.158 .
192.168.1.1 mjob [06/May/2020:21:08:49 +0200] "PUT /remote.php/webdav/Photos/2020/05/2020-05-05.23-47-06%205677.jpg HTTP/2.0" 204 581 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/3.0.0" 2.108 2.108 .
Steps to reproduce

Neither by uploading from within the app, nor with taking a photo and opening the app to trigger the auto upload caused this. So I think this is happening with the background upload job, but I'm not able to trigger it easily.

What should happen

It should upload only once. This will fix many of the "423 file locked" banners that are visible when uploads are in process.

This is also a revival of #245

iOS version is 3.0.0 (and then whatever beta version that was available on 06/May/2020)

cc @marinofaggiana

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

Start by investigating the background upload job in the iOS app and use the supplied WebDAV logs to trace why each photo is requested multiple times. Done means each photo is uploaded exactly once and duplicate requests no longer produce 423 file-locked responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
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.