Closed benjaminor closed 3 years ago
Alright, I think these changes would do the job.
I've tested them succesfully on Android-Studio and on my own device which runs Android 8.
On the other hand, I'm having second thoughts about adding complexity for a feature that is, judging from the issue #870, not much asked for (admittedly I don't have the issue anymore, too). I'll close the pull request for now, feel free to open it again if you have a different opinion.
P.S.: For a simpler change, one could only set the timeouts to a new, fixed value (say 20 seconds, at the moment the default of OkHttp is 10 seconds) in the WebdavRepo.kt file: https://github.com/orgzly/orgzly-android/blob/44004abbbf9fc3020d19aee144debf9c9fb715b2/app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt#L49-L56 and leave aside the logic to let the user customize the timeouts.
I've doubled the values for now, we can see how that goes and add preferences later, thanks.
Hey, I think this pull request would do the job of enabling a custom timeout for WebDAV repos which have a problem when syncing because the server is too slow (see #870).
This change would use a user-defined value (in seconds) for all three different timeouts which one can set with OkHttp (connectTimeout, readTimeout, writeTimeout). I thought this would be better for simplicity.
UI would look like this:
I've tested this with my nextcloud, it seems to be working so far.