nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.92k stars 867 forks source link

Photo auto upload doesn't happen on latest testflight either #2697

Open reeveyoung opened 8 months ago

reeveyoung commented 8 months ago

Steps to reproduce

  1. configure nextcloud IoS app with auto upload photoes
  2. clear nextlcoud ios log
  3. take a picture
  4. wait for a few minutes, and no photo uploaded to server

Expected behaviour

I expect the photo shall be uploaded to server

Actual behaviour

The picture take on 14:14, but actually uploaded happened on 14:23 after opening the app. Or I haven't waited long enough?

Screenshots

If applicable, add a screenshot showing the issue.

Logs

2023-12-04 14:13:37 [INFO] Clear log with level 1 Nextcloud Liquid for iOS 4.9.3.3 © 2023 (Simulator / TestFlight)
2023-12-04 14:13:48 [INFO] Application will resign active
2023-12-04 14:13:49 [INFO] Application did enter in background
2023-12-04 14:13:49 - Auto upload: true
2023-12-04 14:13:49 - Auto upload in background: true
2023-12-04 14:13:49 - Refresh task: ok
2023-12-04 14:13:49 - Processing task: ok
2023-12-04 14:23:02 [INFO] Application will enter in foreground
2023-12-04 14:23:03 [INFO] Application did become active
2023-12-04 14:23:03 Network request started: POST https://10.0.0.2/ocs/v2.php/apps/notifications/api/v2/push
2023-12-04 14:23:03 Network request started: GET https://10.0.0.2/status.php
2023-12-04 14:23:03 [INFO] Automatic upload, new 1 assets found [Init Auto Upload]
2023-12-04 14:23:03 Network request started: MKCOL https://10.0.0.2/remote.php/dav/files/reeve/Photos
2023-12-04 14:23:04 Network response request: https://10.0.0.2/status.php, result: success(170 bytes)
2023-12-04 14:23:04 Network request started: GET https://10.0.0.2/ocs/v2.php/cloud/user
2023-12-04 14:23:04 Network request started: MKCOL https://10.0.0.2/remote.php/dav/files/reeve/Photos/2023
2023-12-04 14:23:04 Network request started: MKCOL https://10.0.0.2/remote.php/dav/files/reeve/Photos/2023/12
2023-12-04 14:23:04 Network response request: https://10.0.0.2/ocs/v2.php/cloud/user, result: success(1119 bytes)
2023-12-04 14:23:04 [INFO] start synchronize Favorite
2023-12-04 14:23:04 Network request started: REPORT https://10.0.0.2/remote.php/dav/files/reeve
2023-12-04 14:23:04 Network request started: GET https://10.0.0.2/index.php/avatar/reeve/384
2023-12-04 14:23:04 Network request started: GET https://10.0.0.2/ocs/v1.php/cloud/capabilities
2023-12-04 14:23:04 Network request started: GET https://10.0.0.2/ocs/v2.php/apps/dashboard/api/v1/widgets
2023-12-04 14:23:04 [INFO] Automatic upload added 23-12-04 14-14-18 0014.heic with Identifier 18EF02B8-C2F2-43FD-8BBA-D07F77DC97E2/L0/001
2023-12-04 14:23:04 [INFO] Start createProcessUploads
2023-12-04 14:23:04 [INFO] Initialize Auto upload with 1 uploads
2023-12-04 14:23:04 [INFO] PROCESS-UPLOAD find 1 items
2023-12-04 14:23:04 Network response request: https://10.0.0.2/ocs/v2.php/apps/notifications/api/v2/push, result: success(1038 bytes)
2023-12-04 14:23:04 Network request started: POST https://push-notifications.nextcloud.com/devices?format=json
2023-12-04 14:23:05 Network response request: https://10.0.0.2/remote.php/dav/files/reeve, result: success(156 bytes)
2023-12-04 14:23:05 [INFO] end synchronize Favorite
2023-12-04 14:23:05 [INFO] start synchronize Offline
2023-12-04 14:23:05 [INFO] end synchronize offline
2023-12-04 14:23:05 [INFO] Upload file 23-12-04 14-14-18 0014.jpg with Identifier 18EF02B8-C2F2-43FD-8BBA-D07F77DC97E2/L0/001 with size 2957068 [CHUNK 0, E2EE false]
2023-12-04 14:23:05 Network start upload file: https://10.0.0.2/remote.php/dav/files/reeve/Photos/2023/12/23-12-04 14-14-18 0014.jpg
2023-12-04 14:23:05 [INFO] Upload file 23-12-04 14-14-18 0014.jpg with task with taskIdentifier 3
2023-12-04 14:23:05 Network response request: https://10.0.0.2/ocs/v2.php/apps/dashboard/api/v1/widgets, result: success(1382 bytes)
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/apps/files/img/app.svg
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/ocs/v2.php/apps/files/api/v1/directEditing
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/ocs/v2.php/apps/user_status/api/v1/user_status
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/apps/user_status/img/app-dark.svg
2023-12-04 14:23:05 Network response request: https://10.0.0.2/ocs/v2.php/apps/files/api/v1/directEditing, result: success(753 bytes)
2023-12-04 14:23:05 Network response request: https://10.0.0.2/ocs/v2.php/apps/user_status/api/v1/user_status, result: success(223 bytes)
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/apps/activity/img/activity-dark.svg
2023-12-04 14:23:05 Network request started: GET https://10.0.0.2/extra-apps/calendar/img/calendar-dark.svg
2023-12-04 14:23:06 [SUCCESS] Upload complete https://10.0.0.2/remote.php/dav/files/reeve/Photos/2023/12/23-12-04 14-14-18 0014.jpg, result: success(2957068 bytes)
2023-12-04 14:23:06 Network completed upload file: https://10.0.0.2/remote.php/dav/files/reeve/Photos/2023/12/23-12-04 14-14-18 0014.jpg
2023-12-04 14:28:16 [INFO] Application will resign active
2023-12-04 14:28:16 [INFO] Application did enter in background
2023-12-04 14:28:16 - Auto upload: true
2023-12-04 14:28:16 - Auto upload in background: true
2023-12-04 14:28:16 - Refresh task: ok
2023-12-04 14:28:16 - Processing task: ok

Reasoning or why should it be changed/implemented?

Isn't it an important feature?

Environment data

iOS version: iOS 17.2

Nextcloud iOS app version: Nextcloud Liquid for iOS 4.9.3.3 (latest testflight)

Server operating system: ubuntu 23.04

Web server: Apache

Database: mysql/redis

PHP version: 8.1.25

Nextcloud version: see Nextcloud admin page 27.1.3

reeveyoung commented 8 months ago

I read lots of posts and some said it's working, but not working for me no mater what I tried. This feature is so important that is the main reason to use nextcloud iOS client. Please tell me how to fix it if it's not a bug.

ne20002 commented 8 months ago

The auto upload is not happening right away if the app is not in foreground. For me it seems to work with 4.9.2 where the auto upload starts some time at night when fully charged.

But I aggree with the 'most important' statement.

reeveyoung commented 8 months ago

Did a long testing. Took photos without opening the app for two days, I can confirm there is nothing uploaded to server.

ne20002 commented 8 months ago

I stand corrected. After my user now got the update to 4.9.3 the auto uploads stopped working. :(

marinofaggiana commented 8 months ago

from your log:

12-04 14:28:16 - Auto upload: true 2023-12-04 14:28:16 - Auto upload in background: true 2023-12-04 14:28:16 - Refresh task: ok 2023-12-04 14:28:16 - Processing task: ok

works ... but the other log lines ??

ne20002 commented 8 months ago

With 4.9.6 auto upload still doesn't work. It only worked with 4.9.2. Funny thing, this.

Rade0nFighter commented 7 months ago

Not test flight but not working for me either.

Nextcloud liquid for iOS 4.9.6.1 Nextcloud server 27.1.4

used to sync dozens/hundreds photos a month but I’ve only had a few photos upload in the last couple of months.

Have reset app, uninstalled etc but no joy - it doesn’t seem to recognise that there are any photos 99 times out of 100.

Any info I can provide that might help just ask.

tzerber commented 7 months ago

Any news on this? I have the same issue on two apple devices (out of two, sadly). I'm no iOS expert, but if there's anything I can do to speed up the fix of this please shoot a message, because it's obviously a bug that needs fixing.

richardbeumer commented 7 months ago

Any news on this? I have the same issue on two apple devices (out of two, sadly). I'm no iOS expert, but if there's anything I can do to speed up the fix of this please shoot a message, because it's obviously a bug that needs fixing.

Same here, have 3 devices where 2 have this issue and the other one is working correctly. If I can be of any assitance by troubleshooting or uploading logging. Please ask.

ueismann commented 7 months ago

same here. NC Server 28.0.1 & 28.0.0 NC Liquid 4.9.6.1

MarianoRD commented 7 months ago

I can reproduce the issue, the auto upload simply doesn't work. In my case not even the number of photos to upload is updated until I open the application.

scerelli commented 6 months ago

Also for me, it works only if I keep the app on screen. If the app is open but is in background it won't work.

The it happened that, while uploading pictures, app on screen. The upload was on my external s3, the app crashed. I reopened the app, it asked me to login again and it started the upload from scratch. All the 10.000+ pictures :S

jactra1 commented 6 months ago

Photosync has own solution. Why Nextcloud won't do the same? https://www.photosync-app.com/support/ios/answers/how-do-i-automatically-transfer-photos-once-a-day

HLFH commented 4 months ago

I was currently migrating to PhotoSync on iOS but I do not want to upgrade to Pro (upload without quality loss) or Premium (auto upload). Maybe there are other alternatives? (open source) As this primary feature did not work for a long time on Nextcloud for iOS, maybe there are open source WebDAV sync solutions?

EDIT: iCloud photos sync solution is a no-go because limit is 5GB and I have more than 70GB+ of photos & videos on iOS.

ueismann commented 4 months ago

Please please make this work again. For us iOS users, that must be one of the features missing the most...

HLFH commented 4 months ago

As a workaround:

1) Uninstall Nextcloud for iOS 2) Download Nextcloud Desktop for MacOS 3) Set up two-way synchronisation Nextcloud server <> MacOS but only for the Photos folder of Nextcloud 4) Wait for the Photos sync to complete 5) Connect iPhone to MacOS via a Lightning cable 6) Launch the Image Capture app on MacOS 7) Select the Nextcloud > Photos folder for import 8) Click on the Action button "..." 9) Click on Image Capture as default app when the iPhone connects to the Mac 10) Click on "Delete after import" 11) Click on "Download everything"

ueismann commented 4 months ago

Thanks! Unfortunately this only seems to work for people using MacOS devices (which I don't, I only have the iPhone).

marinofaggiana commented 4 months ago

Hi, we can't figure out where the problem is. Why doesn't it work for you? (in background ?) or not only ?

marinofaggiana commented 4 months ago

I can reproduce the issue, the auto upload simply doesn't work. In my case not even the number of photos to upload is updated until I open the application.

Without LOG your response is not constructive.

scerelli commented 4 months ago

@marinofaggiana to reproduce just install nextcloud app on ios and choose to upload all the images in the camera roll (the pics already there not the pics you will shoot). Close the app the images won't upload.

Rade0nFighter commented 4 months ago

I have found a workaround for auto uploads - that seems reliable for me at least:

I just need to make sure to tap the screen every few seconds to keep the screen on and the app “awake”.

Hope this helps someone.

Have only had to do this since the second half of last year.

marinofaggiana commented 4 months ago

@scerelli Why close the app the images won't upload ?

have you read the Warning ? ... maybe is not clear ?

Simulator Screenshot - iPhone 15 - 2024-03-26 at 11 15 19

scerelli commented 4 months ago

Firstly, I did not receive any warnings, nor was there an option to create an archive. Instead, the system uploaded my 5,000 images individually and i had to keep my phone on with the screen on to make it work, for several hours. While uploading 10 images individually might be manageable, this approach is impractical for users with a large number of images. I believe a more efficient solution would be to adopt a method similar to Google Photos, where images and videos continue to upload in the background.

ueismann commented 4 months ago

Dear All,

@marinofaggiana 's functionality above worked for me, but that was not the point of this issue and it's predecessor. Instead, the functionality we were looking for is automatic upload of new photos once they are shot (or the next time WiFi is reached) and in the background without opening the app. It is a feature that is expected by "automatic uploads" and works with basically all cloud implementataions except for NC on iOS.

MrGoMario commented 4 months ago

I have the EXACT setup as the OP and indeed it does not work. For whatever reason iOS "forgets" to start the uploading process. Clearly, this is not a NextCloud issue. And honestly, I don't think this can be fixed by us on github. At best we might be able to find a workaround...

MrGoMario commented 4 months ago

Photosync has own solution. Why Nextcloud won't do the same? https://www.photosync-app.com/support/ios/answers/how-do-i-automatically-transfer-photos-once-a-day

Because we don't want it to work that way. The Fotos should upload as soon as they are taken and not at some arbitrary point in time (or trigger dependent). Yes, you can trigger an autotransfer either based on location, (when you arrive at a certain location), or from a fixed time or when your device is connected to the charger cable. But that is not the point...

deltabravoz commented 3 months ago

@marinofaggiana

Hi Marino, I've just installed Nextcloud last month and I use it for backing up files of the whole family and for all the great stuff Nextcloud could bring with his self-hosted server.

I use Android device as well as my son and my wife and my daughter are using iOS devices.

It was a disappointment to see how auto-upload was working on iOS after trying it myself on android. I read all the forums here on github before deciding to write this comment. I have well understood the limitations that apple done on background jobs. The small ones with less than 20s to be alive and the bigger ones and the fact that users have to wait with nextcloud on the foreground without leaving the app or even the screen locking during the first upload.

For exemple, my daughter has approximatively 115Go of pictures and videos to be uploaded at the first upload. Can you imagine the time she would have to stay in front of the screen to make it work? Even if she stops screen locking... What is not always possible on some professional devices where the company forced screen locking at minimum 10 minutes like on the iPad my company lent me...

On mobile, I think it's one of the main feature that people wants to use. I used to be a dev and I would never answered a customer or a user : "To make it work, you have to switch on the dryer before the washer then jump three times the higher you can, make three wishes and applause with your feet at the same time"!

I know that's a hard issue and that apple operating system isn't a help here. It is real that in fact, this iOS is an issue by itself with these limitations. But the bug is being reported since at least two years! I can't ask my girls to wait a night for their pictures to be uploaded, I'm sorry... Nobody can ask that to a user or it means that the apps is not working or at least this feature is not working and it should be removed from end-users versions.

If I asked my girls what to do with nextcloud working like that, I think their answers would be "direct throw to the garbage"! As I am the admin of nextcloud for my home, I can't let them like it.

I see three solutions for this issue : 1/ You choose to come back to something working like it was with the GPS trick 2/ You remove the feature 3/ You wait apple to change his background managment for years

And for me 2 and 3 are not options finally for users... For the GPS complainers that do not understand why using GPS to sync files... That is their choice to use others apps. But all the features have to work perfectly to be present in a end-users version. And it's not the case actually. The fourth solution would be to retro-engineer an app that make this kind of background jobs working even when the app is not in background. How does apple do to sync with iCloud all the pictures? Does they have a backdoor?

You make great work on the app. I hope you understand I just comment to make everyone thinking about the way this real issue could be resolved. And the main statement is the end-user is always right : if something don't work as he is expecting, that's the dev's fault, not the user one. We, as dev, have to give the users what they are expecting and not some tricks to make something approximatively working.

I support the GPS transparent solutions to make first and new uploads work. Thanks, Keep up the good job!

deltabravoz commented 3 months ago

By the way, I was thinking how does Amazon do with the automatic upload on iOS because if I don’t make a mistake, pictures are uploaded immediatly, no?!

deltabravoz commented 3 months ago

One last thing : Just create the option "Upload when GPS triggers position change" with the choice for user between using it or not and specify that if the option is not chosen, GPS will not be used by the app and if the option is chosen, the app will use the GPS only to trigger more often the upload of the pictures and for first upload of the camera roll...

Would everybody be happy with such a solution?

ueismann commented 3 months ago

I would be. I am open to any solution that works...

tzerber commented 3 months ago

I am also okay of any solution that would fix this issue once and for all

Rade0nFighter commented 3 months ago

Follow up from my previous comment- seems to working for me now! There’s always one notification there as if there’s a file left to upload but I’ll take that.

Nextcloud Hydrogen for iOS 5.2.7.0 © 2024 Nextcloud Server 27.1.9

tassoman commented 1 month ago

Would Apple complain if file uploading is kept by listening music in background? 🙄 🎼
Just in case, if GPS coords can't be updated ...

kubrickfr commented 1 month ago

Just in case, if GPS coords can't be updated ...

AFAIK it has nothing to do with GPS. It's linked to the location permissions because if you can wake up the app in the background at any time, you can track the location of a user using its IP address.

I have a Garmin sports watch for example, background sync only works if I allow access to location. The watch itself has GPS, clear the app doesn't need GPS permissions, but that's the only way to sync in the background in iOS.

jamesy0ung commented 1 month ago

Tesla app and Sidestore also request location. If location permission is granted, it allows the application to execute in the background.

saqwerty commented 1 week ago

I don’t think location permission is the root. Microsoft OneDrive works fine without location permission