syncthing / syncthing-android

Wrapper of syncthing for Android.
https://syncthing.net/
Mozilla Public License 2.0
3.47k stars 390 forks source link

Use asynchrounous sequences when updating config #398

Closed Zillode closed 8 years ago

Zillode commented 9 years ago

On line https://github.com/syncthing/syncthing-android/blob/2ed6dac071fbb5757653054724906370e557edfc/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java#L359 there is a race condition because the PostTask might not be completed before restarting Syncthing. To solve this, an asynchronous sequence (PostTask.Then(Restart)) is required, but that might be an issue for callers which expect blocking behavior to make sure Synchting is halted before continuing.

Nutomic commented 8 years ago

To summarize our discussion from irc, here's what we should do:

  1. a setting is changed
  2. show the restart dialog, if it wasn't dismissed earlier
  3. send the updated config to syncthing
  4. restart syncthing
Zillode commented 8 years ago

:+1: