-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Reduce HTTP Timeouts #15210
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
base: master
Are you sure you want to change the base?
Reduce HTTP Timeouts #15210
Conversation
Thanks for that idea. NextcloudClient can be changed in android-library, thus then using the same timeouts. However I am open for discussions how to improve/change.
|
Signed-off-by: Alex Knop <[email protected]>
Signed-off-by: Alex Knop <[email protected]>
Defaults for OkHttpClient appear to be 10 seconds from research, but I am not finding where or how it is changing to higher values in the app. The appcontext is passed into the builder and its possibly layered in the appcontext. As for other apps, i am really not sure. There is a boolean in OkHttpClient for retryOnConnectionFailure which you could set to false and that would help the retry issue. I know my case is unique, but I imagine there are other connection scenarios which could create this same pain point, such as having your server accessible over VPN to a private IP and this reacting the same way when not on VPN but connected to the internet. I am not sure if this same scenario applies to a publicly accessibly nextcloud server and the server is down. |
Signed-off-by: Alex Knop <[email protected]>
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15210.apk |
blue-Light-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/15210-Screenshot-blue-Light-01-21 |
I have a Nextcloud server with a private server address (192.168.1.2).
When launching the app on my cell phone when I had Wi-Fi off but Cellular data on, I noticed a spinning wheel for about a minute when Nextcloud starts.
I discovered there are many HTTP requests happening on app startup with timeouts of a minute. This can hinder the ability to open offline photos when in this state, possibly due to the many threaded processes.
I think 60 seconds is excessive and was able to manually set timeouts prior to these requests. I have them set to 3 seconds and the app is responding fine now, but I'm open to discussing a better solution to this.
The OwnCloud Client objects have a function to set the default timeouts, but the Nextcloud Client objects do not, and so I had to do so via reflection.
I do not see this issue when on other Wi-Fi networks, possibly because they also use the 192.168.1.0 network and the server availability is determined quicker, but since I use a private IP server, this behavior is noticeable when not on my home Wi-Fi.
Lastly, besides startup, I noticed longer times to load files via the DocumentStorageProvider when my phone is in this connectivity scenario and have a fix in here for that.