nextcloud / windows-universal

📱 Nextcloud Windows Mobile app
https://www.microsoft.com/store/apps/9nblggh532xq
Mozilla Public License 2.0
59 stars 34 forks source link

Implement the function to synchronize selected directories in the background #10

Open SunboX opened 8 years ago

TheScientist commented 8 years ago

I'll have a try on that:

  1. Context menu for directories to sync
  2. When clicking that context menu, user needs to select a target folder on his/her device
  3. Add folder to FutureAccessList (to make it readable for Background Task)
  4. Create BackgroundTask running every x Minutes to compare synced directories with local copies

Another approach would be to use the Cached File Updater Contract (see https://dzone.com/articles/how-use-cached-file-updater) to always sync files before reading or after writing them on the device, but as I understand that's more useful if you edit a file from nextcloud and want to upload the updated content afterwards, without saving it locally.

SunboX commented 8 years ago

Hey, nice!

Your suggested behavior sounds good. But we should also find a solution for syncing folders that are only on the device by now (and not in the cloud). Additionally there should be a way to remove the sync of a folder.

TheScientist commented 8 years ago

Started with some basic stuff like adding menuflyout item and saving information for the folders to synchronize in db. If someone is interested, the branch is linked above.

TheScientist commented 7 years ago

Manual sync working (mostly). Next:

TheScientist commented 7 years ago

Has somebody an idea how to handle conflicts, e.g. file has changes locally and remotely? The easiest option to implement would be to use a default option (selectable in settings) like:

The other option would be to ask the user for every conflicted file. Maybe a separate page containing all conflicts with the above options to solve them or even a comparison view.

What do you think?

SunboX commented 7 years ago

I would prefer the second option, a separate site with all conflicts listed, so you can choose the resolution by file (or select all files). But I'm open for discussion. 😄

Btw., great work! 👍

TheScientist commented 7 years ago

I'd like to ask you for testing the current state. Manual sync is finished from my perspective but may needs more error handling. I'll start to put all needed code in a background task library next week. This will also include common code like DirectoryService and ClientService. It would be possible to merge the current state into master - manual sync is better than none :)

SunboX commented 7 years ago

Hey, this sounds great! I havn't much time the next days. Let's see, maybe I find some time on the weekend. Thanks a lot for your work, this feature is really great and necessary. 👍

SunboX commented 7 years ago

Finally I got some time to try it out. Looks good to me! Maybe we should show a message box / a local push, if the app gets supended during synchronisation. So the user knows that it didn't finish and he has to restart it manually. This happens for example if the lock screen appears during sync (because synchronisation takes a long time).

Could you do a merge request for the current functionality?

Btw. do you know some nicer way to rely on SQLite? Maybe using NuGet? So we can avoid such things: https://github.com/SunboX/windows-universal/commit/b162478a08963a0f3855014052492f9ca0d3cc15

Maybe @altima knows a better way to do this?

TheScientist commented 7 years ago

I think the anniversairy update sdk contains sqlite, so we could remove the dependency if we update the min Version for the app. I'll add the info when the app/sync get's suspended and create a pull request afterwards. But it won't be until next weekend.

SunboX commented 7 years ago

I think the anniversairy update sdk contains sqlite, so we could remove the dependency if we update the min Version for the app.

Ok, let's do this with the next app version (1.2.x) not the current one (1.1.0), so the users will have a bit more time to upgrade. 😄 By now I'm fine with using the UWP SQLite thing.

I'll add the info when the app/sync get's suspended and create a pull request afterwards. But it won't be until next weekend.

That's great, I also need some more time for the final 1.1.0 stuff. So no hurry, let me know if you have something I can merge. Would be nice to have this functionality in the app version 1.1.0.

TheScientist commented 7 years ago

This issue can be closed, as we have #108 and #187