Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Feature Request: Different synchronisation conditions per folder #57

Closed
Catfriend1 opened this issue Sep 15, 2018 · 22 comments
Closed
Assignees

Comments

@Catfriend1
Copy link
Owner

Quote from @cdrfun at syncthing/syncthing-android#1225

Hi there, it would be great if you could define different synchronisation conditions per folder.
Possible use case:
One folder which is important should always be up to date - no matter if I'm on WiFi or battery. For me this would be my folder with the password manager database.
Other folders like photos could be synched only with WiFi and/or battery.
Would this be possible given the current architecture?
What do you think about this idea, aside from technicalities.
Greetings!

@Catfriend1 Catfriend1 self-assigned this Sep 15, 2018
@Catfriend1
Copy link
Owner Author

Hi @cdrfun !
I'm currently working on many improvements for the wrapper. Yes, it would be possible and I've already made a development for this feature that fits to your description. Thanks for writing it up. When I'm done with the compatibility and bug fixing stuff I'll go on this challenge.
Kind regards
Catfriend1

Catfriend1 added a commit that referenced this issue Sep 21, 2018
@Catfriend1
Copy link
Owner Author

Catfriend1 commented Sep 21, 2018

@Catfriend1

This comment has been minimized.

@Catfriend1
Copy link
Owner Author

Ok, I thought about this a lot ... I'm going for an implementation where every device and folder has a submenu "specify my sync conditions so I know when syncing this object's stuff is valid" e.g. Wifi with name "HOME" for folders A,B and Wifi with name "FRIENDS" for device "FRIEND".. All in all, those options would be expert options, so a checkbox needs to be ticked in the settings to make them visible. A "0815" user would else be confused by all those run conditions ;)

@Catfriend1

This comment has been minimized.

@Catfriend1
Copy link
Owner Author

Catfriend1 commented Sep 24, 2018

image

@cdrfun
Copy link

cdrfun commented Sep 25, 2018

That looks great! Keep up the good work!
Are the folders paused f the sync conditions are not met?

@Catfriend1
Copy link
Owner Author

Yes, thats intended.

@Catfriend1
Copy link
Owner Author

image

@Catfriend1
Copy link
Owner Author

Hi,
the intermediate status is that I've completed the UI implementation. I will now work on the technical part to make per-folder sync conditions possible.

@Catfriend1
Copy link
Owner Author

@Pazuu @cdrfun Hi together,
I've implemented a working solution. It's young and needs testing even though it already worked correctly on the emulator test. Will you assist me, then I'd post an APK for testing in a few hours.

@Catfriend1
Copy link
Owner Author

The feature is implemented and released.
See #66 and https://github.com/Catfriend1/syncthing-android/releases/tag/v0.14.51.6 (release page).

@cdrfun
Copy link

cdrfun commented Oct 23, 2018

Really nice work!
I had some time to test today, and here is what I've found. (If needed I'll create a separate issue(s)). Some of my labels might not be correct, because I'm using the German version. I use numbers for better referencing, not to indicate any importance:

  1. Folder-Sync condition Start at selected Wifi can't be activated when a option page for an folder is opened where start with wifi is activated. When deactivating/activating the option start with wifi, the option Start at selected Wifi can be set.
  2. Currently folder sync conditions can only limit the folders sync conditions compared to the global conditions. I understand that it is good to have some kind of a global limit. But this puts the user in a tricky situation when he wants one folder to "always sync". He has to max out the global conditions and limit all folders bit the always sync folder. additionally he has to remember to limit all new folders, or he will use more traffic than he thought. Perhaps a separation of syncthing starting conditions and default folder conditions would be a solution.
  3. The Folder-Sync condition dialog has a checkmark in the upper right. This is not necessary, because changes are saved when going back (either using the arrow in the upper left or the back button). Additionally when pressing the checkmark the folder options dialog is revealed and here is the trash icon at the same position. This is not consistent.
  4. When wifi connection is lost, and some folders are configured to run on mobile, syncthing seems to restart completely instead of just pausing non mobile folders. When the wifi connection is regained, syncthing just unpauses the folders - which is correct.

@Catfriend1
Copy link
Owner Author

Thank you for your detailed feedback ! @cdrfun
Please tell me which APK version / release you used for testing this. I guess (1) is already fixed by 0.14.51.8+?

@cdrfun
Copy link

cdrfun commented Oct 23, 2018

Doh, my bad. I've used the last released apk version: Syncthing v0.14.51.8 / 4171

@Catfriend1
Copy link
Owner Author

@cdrfun I'll take the other points on my development plan. Will take some time but definitely is where I want to get in the future to transition over to the new run conditions without global vs. object mismatches.

@Catfriend1
Copy link
Owner Author

@metal450 I know this is not about intents, but if you like to unpause your folders according to run conditions maybe this is for you...

@metal450
Copy link

Cool :) Though it doesn't seem like it provides a way to manually sync specific folders only on-demand, which is what I'm trying to accomplish.

@Catfriend1
Copy link
Owner Author

Catfriend1 commented Jul 15, 2019

Maybe you can use the Tasker intent control in the fork's app settings and combinate with http post requests to Syncthing's REST Api sent by tasker. Pausing and unpausing shouldn't be difficult by the api. :)

Note: If you enable broadcast intent control in the app settings, the RunConditionMonitor will be totally disabled.

@metal450
Copy link

Pausing and unpausing shouldn't be difficult by the api. :)

In the API docs, I only see a way to pause per device - not per folder: https://docs.syncthing.net/rest/system-pause-post.html

@Catfriend1
Copy link
Owner Author

According to what imsodin wrote on the forum the docs are outdated... Please ask him on the forum, In expect this endpoint also works for folders.

@metal450
Copy link

Sounds good, thanks for the pointers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants