Repository navigation
Upload of locally changed files #757
Description
Activity
Did you mark the file as available offline in the Nextcloud Android app?
I noticed this too, all (PDF) files I open from nextcloud are copied to the download folder and opened from there. It does not matter if the file is synchronized (available on the device), marked as available offline or online. Tested with NextCloud 1.4.2 app on a Nexus 5X (Android 7.1.1)
copied to the download folder and opened from there
Do you mean the data folder of Nextcloud or the phone's actual download folder? If the file is opened from within the Nextcloud app referring to another app (tried it with a Word document then edited in Google docs app) and eg a Word doc I just tested with NextCloud 1.4.2 app on a One Plus 3 T (Android 7.1.1) file being marked as "available offline" works just fine.
in my case, I am talking about the NC cache folder, but the procedure is the following: I have a file which is not available offline, click on the file in the NC-App, it is beeing downloaded, in the action menu, I press on "Open with" and select an Editor (e.g. DroidEdit). The editor openes, I change something, save it and return to the NC-App, but nothing happenes.
Same issue with a PDF-Document.
So we are not talking about the phone's download folder of course, just the NC-Caching folder!
Hi everybody!
I would suggest the same thing. I already lost a file because of the missing auto-sync function. I am not an Android expert. But when opening a file for editing (no matter in what program), maybe a watch dog process should be started to track the changes. Afterwards, it could upload the changes automatically to the server.
Imho there should not be a difference between marked / not marked as offline available. I can't expect sombody editing an online file and not wanting it to be synced afterwards. At least there should be a warning: "File has been updated. Do you want to sync it to the server?"Thanks a lot!
@christianh95 the download folder question came due to @PaulFreund's comment plus combined with your comment, some remarks: The Nextcloud app downloads the files to the app's data folder, Thumbnails are put into Nextcloud's cache folder (no copying here or anywhere...). So if a file is marked as "available offline" and edited then it should be synced back to the server (or this is a bug even in today's implementation)
@spectas @christianh95 I understand your request and also think all files which made it down to the app's/device's storage should always be kept in sync, but unfortunately it is way trickier than you think as you are requesting this feature about which I already had discussions with @jancborchardt and @eppfel
- when to keep in sync? on cellular? wifi only, when charging only?
- what to keep in sync? any file of any size e.g. what should happen with a 2GB video file edited on your phone (...when being on a cellular network)
- how to resolve the conflict with the user request to NOT store any file on the device when opened, just put it into RAM and delete it right after it is closed?
Any input or suggestions anyone on how to handle these situations? (Obviously I would like to make everyone happy!) 😄
I am a very beginner on android development, but shouldn't it be possible to apply a FileObserver event handler on all (or selected) files in the app's data folder to monitor changes and upload them again in the background? If I compare it with the Dropbox-app (that I want to get rid of), the files are instantly uploaded on every external change, no matter if you are in cellular of wifi! That's the behavior I would expect, maybe even with a possibility to configure the behavior on cellular/wifi individually.
a) Instant upload isn't a reality anymore after the changes done with the platform
b) FileObserver is fundamentally flawed as it relies on inotify which is broken on many phones and vendors
c) Ideally, full sync will be done via a Sync Adapter anyway and it's focus won't be on "instant upload" or speed, but on reliabilityReacted by NetDwarf@christianh95 commenting on dropbox I have to disappoint you: it doesn't anymore, your phone OS might just be too old, the issue is that this "instant behavior" has been forbidden/prevented on newer Android version and started with 6 and has gotten way more restrictive with 7 :( That is also the reason why we implemented auto upload since the former instant upload won't even work anymore under Android 7 since scheduling work now needs to be done by Android itself...
@AndyScherzinger thank you very much for your considerations.
Current behaviour:
- I select sync on a folder and all files in it are downloaded to the applications data folder
- I click on a file to open it and select Xodo docs or Adobe Acrobat as a handler
- The file will be copied to the download folder (it it has been opened before it will have an increment number (e.g. "Document (1).pdf")
Proposed behaviour:
- The app lets you decide a location where to sync the files to on your data partition (so other applications are able to access the files)
- Available offline should work with every file and folder and create an entry in a synchronisation list
- In regular intervals (maybe configurable) an indexer generates hashes of the available files and compares them with the server status and creates a task to download/upload all of them to get in sync (like windows client behaviour but without file system hooks)
- If the app is open there should be a synchronisation indicator similiar to windows and a display of the last index time
I think the indexing frequency does not need to be very high as long as the user has a way to see the current status and maybe trigger a direct index and sync.
Reacted by Carlo Jeske, Markus Lasermann and Simon HärerHope this is the right issue to add my experience:
When changing a file locally on my device, i.e. using a text editor, nextcloud app won't notice this until I start the nextcloud app and navigate to the folder where the file is located in. I'm using "make file offline available" (sorry for bad translation from german), it doesn't make any difference to not marking it offline available.
Details: nextcloud app 3.4.1, on a Samsung gaalxy S5 with linageos 15.1.
Use case is i.e. https://github.com/mpcjanssen/simpletask-android/, an app which saves tasks to a local text file.
#2395 is possibly related
@varac with next version all downloaded files will synced every 15min when on wifi.
We cannot detect a change of a local file correctly. E.g. if we use a change listener, when do we want to sync? After each sync? Imagine you write a text and save after each sentence.
Maybe you want to use https://play.google.com/store/apps/details?id=nl.mpcjanssen.simpletask.nextcloud instead?
@varac with next version all downloaded files will synced every 15min when on wifi.
Ok, nice!
We cannot detect a change of a local file correctly. E.g. if we use a change listener, when do we want to sync? After each sync? Imagine you write a text and save after each sentence.
Well, same for the desktop client right ? It does watch for changes and uploads them on every change, no matter how often you save the file. Why should nextcloud-android behave differently ?
Maybe you want to use https://play.google.com/store/apps/details?id=nl.mpcjanssen.simpletask.nextcloud instead?
I'm using simpletask nextcloud from f-dorid already (built from https://github.com/mpcjanssen/simpletask-android).
18 remaining items
This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!
Reacted by Marius Bergmann, Sven-Hendrik Haase and Jo SpragueWell, closing the issue won't make the problem go away.
Reacted by Sven-Hendrik Haase, Jo Sprague and superzantiThis request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!
Reacted by Jo SpragueHello here.
This issue is still happening for me on Android 12, Nexcloud Android Client 3.21.2 and Nextcloud Server 24.0.2
Any new plans to detect changes on android?
I have also been experiencing this issue for years, and I find it frustrating to have to manually sync when files changes, and leads to having to manually merge different versions of my notes countless times.
Currently running Android Client 3.25.0 and Server 27.0. However it has been the same for a dozen versions before that as well.
A year later, I'm also wanting this feature.
I have some notes that I like being synced between my phone, computer, and nextcloud server. But if I change stuff on my phone I have to manually sync it up.
2way sync is currently being implemented by @tobiasKaminsky
Sorry for the long wait but folks are on it, as in really on it as there is already a work in progress Pull Request / implementation.
2way sync is currently being implemented by
@tobiasKaminsky- Is that this one: Internal 2way sync #13294 ?
2way sync is currently being implemented by @tobiasKaminsky
Sorry for the long wait but folks are on it, as in really on it as there is already a work in progress Pull Request / implementation.
Very nice! Are there any plans to implement this function (nextcloud/ios#2670) in the iOS app as well?
If I change e.g. a text file with an external editor, the file won't be updated in the cloud, also after several edits and app-restarts! It only works if I select the file and synchronize it manually! I think this has already been working in the last stable version!
Expected Behavior
NC shoud automatically recognize changes in the local folder and upload them instantly
System: Samsung S5, Android 4.4, current NC app from Play Store