android icon indicating copy to clipboard operation
android copied to clipboard

Allow 2-way-sync

Open ThomasSteinbach opened this issue 8 years ago • 108 comments

When 'syncronizing' a folder in the nextCloud app, actually changes from the remote server become propagated on the mobile device. However changes on the mobile device aren't uploaded back to the remote server.

How the nextCloud app should behave:

  • files added to a synchronized folder should be scanned/recognized
  • changes to files (create, update, delete) of a synchronized folder should be propagated back to the server
  • conflicting changes should open a dialog (overwrite on device/server, rename)

ThomasSteinbach avatar Jun 14 '16 16:06 ThomasSteinbach

@przybylski @tobiasKaminsky can you take a look at this issue? I thought we already this (or have a branch for this) and also I thought we do this for files (but maybe not for folders yet).

AndyScherzinger avatar Jun 14 '16 16:06 AndyScherzinger

As far as I know there is no real 2 way sync yet. I started to implement that any folder can be instant uploaded to server, but that is still an enhanced one way sync...

tobiasKaminsky avatar Jun 14 '16 19:06 tobiasKaminsky

The current situation is this: If you change a file in the phone, you have to open the Nextcloud app, go to the directory where the updated file resides, and drag down with your finger to force a refresh in that directory. Only then your changed file is uploaded to the server and appear on your other devices.

mabkenar avatar Jun 22 '16 09:06 mabkenar

@mabkenar Does this also happen, when you mark the file as a favorite?

AndyScherzinger avatar Jun 22 '16 09:06 AndyScherzinger

Yes. As far as I can tell, making the file favorite (or recently, "Set as available offline") has no effect.

mabkenar avatar Jun 22 '16 09:06 mabkenar

@tobiasKaminsky is this a bug or a works as designed and needs an improvement?

AndyScherzinger avatar Jun 22 '16 09:06 AndyScherzinger

@mabkenar do you have enabled sync in android -> settings -> accounts -> nextcloud? Only then the sync is working, AFAIR

tobiasKaminsky avatar Jun 22 '16 19:06 tobiasKaminsky

Oh I see. I never touched the sync setting after I added my Nextcloud account, and now I see that sync was disabled by default (This is strange. Is this a design decision?).

Now with sync enabled, when I change a file on the server, it only appears in Android if the file is "Set as available offline". For non-"Set as available offline" files, no sync happens.

For the reverse situation: only changes made to "Set as available offline" files are propagated back to the server. All other files remain in the local device until a change in the server causes a conflict.

mabkenar avatar Jun 24 '16 09:06 mabkenar

The situation for non-available-as-offline files that are changed from the server is problematic because while an older version of the files is downloaded to the client (say from 1 day ago), there is still a green tick mark next to the file that implies this file is up-to-date, and the client even says "last changed 10 minutes ago" (but this refers to the change in the server that has not been synced to the client). The file is never updated unless a manual "Synchronize" is issued from the client.

mabkenar avatar Jun 24 '16 09:06 mabkenar

Oh before I confuse anyone, I am using Nextcloud provided by F-Droid, and I don't have Google's non-free stuff installed on my device. Could this make any difference?

mabkenar avatar Jun 24 '16 10:06 mabkenar

As a potential new user this is not very clear to me. Could someone from the organization clarify this? Is this feature (2-way-sync) working/planned/workaround? possibly point us to the docs?

LeonardoGentile avatar Sep 19 '16 09:09 LeonardoGentile

@mabkenar f-droid version with any Google service shouldn't be an issue @LeonardoGentile at the moment the status would be "planned", thus the discussion/issue

AndyScherzinger avatar Sep 19 '16 17:09 AndyScherzinger

@AndyScherzinger any update or timeline for this?

LeonardoGentile avatar Nov 02 '16 09:11 LeonardoGentile

Hi @LeonardoGentile as stated by https://github.com/nextcloud/android/issues/19#issuecomment-225988921 we don't really have a two way sync at the moment. We are working on the first step towards folder sync #285 -> #358. The two way sync is basically the last step planned to be added to that new implementation. A timeline is hard to tell since at the moment all people actively working on the app a community contributors. Since @tobiasKaminsky is aiming at having two way sync this feature has a high priority, not sure if he could name any timeline from his point of view. So for now we only have the road map outlined in #285.

On a file level "Set as available offline" should do the trick at the moment, so you should be able to activate this on a file basis but you can't do it on a (arbitrary) folder level.

AndyScherzinger avatar Nov 02 '16 10:11 AndyScherzinger

Is this the right issue if I just want my phone's camera folder to be synchronized with a folder on Nextcloud, including deletions?

pascalBokBok avatar Feb 25 '17 13:02 pascalBokBok

Yup ;)

mario avatar Feb 25 '17 13:02 mario

Bountysource

thibaultmol avatar Jun 05 '18 11:06 thibaultmol

!remind me in 6 years

BentHaase avatar Jul 04 '18 13:07 BentHaase

What's the state on this? Can someone clarify what does and does not work - e.g. if I mark a folder as synced, will files available in that folder be synced if I make local changes?

clawoflight avatar Sep 10 '19 19:09 clawoflight

As I tested on my phone, with client version 3.8.1, 2-way-sync has only been partially implemented.

Here is the result:

  • Add file in the cloud and press sync button on parent directory in android app: Local file will appear.

  • Remove file in the cloud: Local file will automatically disappear.

  • Add file locally: The file will not be uploaded to cloud even pressing sync in android app, except when there's already a not synced file with same name and path in the cloud, in which case the local file will override the cloud file after pressing sync.

    The only way to upload a new file to cloud in android app is to press "Upload files" and select the file manually.

  • Remove file locally: The file will remain in the cloud, and no longer be synced in android app.

  • Rename file: Renaming is treated to be removing old file and adding new file.

    So, renaming in the cloud will make local file disappear and new file not synced. Press sync will make the file sync and local file with new name appear.

    However, renaming local file will only make cloud file not synced. Thus, pressing sync will only download file with old name and make the old file and new file both exist in local file system, which is not acceptable.

  • The good news is that: Press sync and modification to file content will be propagated to the other side.

    Content conflict will trigger conflict resolution as expected, which let the user choose to keep either or both files.

Here is what has been done and what need to to:

  • [X] Propagate changes to file content to the other side.
    • [ ] No need to press sync every time manually: It should be done automatically.
  • [X] Propagate adding and removing files from cloud to local.
    • [ ] No need to press sync every time when there's new file added in the cloud.
    • [X] No need to press sync every time when there's file removed in the cloud.
  • [ ] Propagate adding and removing files from local to cloud.
    • [ ] No need to press sync or upload every time.
  • [ ] Correctly handles local file renaming, which should be automatically done if local file adding and removing is propagated to cloud.
    • [ ] Detect file renaming and update local/cloud without downloading/uploading file content.

Currently the most important case as I see, propagation of changes to local file content, has been implemented, though it need to be triggered manually.

Hope to see android client work the same way as desktop client.

LiZhenhuan1019 avatar Oct 15 '19 09:10 LiZhenhuan1019

+1 for a 2-way-sync

For my personal purposes, it would not need to be a "live" sync, i.e. I dot NOT want to work on some file and "instantly" see the changes when I change devices, i.e. from mobile to desktop. For me, that would just be nice-to-have.

My use case: Sort of a "devices data merge + backup" for, e.g., photos. So say I have two android devices, I would like to automatically sync my photos between them, i.e. device A uploads its new pictures and, at the same time, downloads the latest pictures which have been uploaded from device B (and vice versa, obviously).

In that context, I would be content with being able to do this cron-job style, e.g. executing that 2-way-sync once per hour/day or so. However, I would hate to have to hit a button every single time for the sync to occur, because, let's face it, I would simply forget to do so (and even if not, it would still be quite annoying)!

rt87 avatar May 13 '21 08:05 rt87

@rt87 I think live syncing vs periodic like a cron would be a good option. Some people care about their battery life so don't want the device polling all the time while others want the latest and greatest.

hockeymikey avatar May 13 '21 15:05 hockeymikey

I realize this is not an easy feature to add but what is the current status on this?

2-way sync is the only thing that is preventing m from migrating to Nextcloud.

If I understand correctly, the desktop client already has a fully featured 2-way sync. Why is it so difficult to bring that to mobile clients as well? (genuinely curious on what is needed from a technical standpoint)

sdimovv avatar Aug 09 '21 22:08 sdimovv

Hi, I created this issue a just a couple of years ago. Any updates on this? 😄

( I "updated" the bountysource to 157$ - if that would help)

Btw - an "officially" supported Syncthing integration would suffice too. Those guys doing a great job. Why not share efforts?

ThomasSteinbach avatar Oct 24 '21 23:10 ThomasSteinbach

I fully agree... actually, I almost stopped using nextcloud because of the lack of this feature and basically migrated to Syncthing already. I hardly use any of the collaboration stuff given that I mostly care about the sync'ing and, oh well, I grew tired of waiting

rt87 avatar Oct 25 '21 08:10 rt87

Can we get status on this from maintainers?

PixsaOJ avatar Oct 26 '21 02:10 PixsaOJ

Hard to believe that over 5 and a half years later, the feature still isn't implemented.

It just strikes me as being a very odd omission as the entire point of NextCloud is data management. I've been using Resilio Sync (Bittorrent Sync) for YEARS and the feature has existed from the beginning, same with SyncThing. I don't see why something like a simple checkbox couldn't be implemented for custom folders.

If anything an integration would suffice.

Is there any update at all regarding this issue?

TheOneOgre avatar Jan 07 '22 09:01 TheOneOgre

Especially hard to understand as the official documentation of the Android app, last updated in 2017 (!), says, I quote:

However, the Nextcloud Android app offers some advantages over the Web interface:

  • A simplified interface that fits nicely on a tablet or smartphone
  • Automatic synchronization of your files

(emphasis mine). Might be unlucky phrasing, but is quite misleading.

I'm using Nextcloud for many years now, and Android for even longer. I never installed the Nextcloud Android app as I saw little use for it. The features I'd expect in the first case from such an app (syncing selected directories) is missing, and most from what is offered I don't need. Seems a bit as if it were an unloved step-child. And just to have photos uploaded automatically, I don't install an app where the APK file already is 30M in size (I wonder what is taking so much space here).

This is a really unhappy situation. I value very much what the Nextcloud team does, so please don't mistake my comment for a "rant". It's just so frustrating that there's no Android FOSS client for the leading FOSS cloud solution capable of doing the basic tasks one expects from a cloud storage: synchronizing files.

(side note: also disappointing is that there's no link to the app on F-Droid, just to Play Store…)

IzzySoft avatar Jan 07 '22 23:01 IzzySoft

Nextcloud Desktop already has everything and is well put. How hard is it for android not to be just a remote browser with media upload function.

PixsaOJ avatar Jan 07 '22 23:01 PixsaOJ

Just got nextcloud set up for the first time and was instantly disappointed that the android app doesn't do 2 way sync. Syncthing would be a great fallback, being FOSS, but it doesn't work with external SD cards because of the language it's written in. So unfortunately I don't yet have the ability to move off of FolderSync. Based on the history of this issue, I guess I shouldn't hold my breath waiting for this functionality but hopefully it'll come eventually. I'm still glad to be getting started with nextcloud. :)

TheShanMan avatar Jan 09 '22 02:01 TheShanMan