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
Reduce connectivity check #3947
Comments
I have a refactoring of this ready on my branch somewhere. |
The main challenge is that the check uses synchronous getter that is called liberally all over the place. To fix this problem we'd probably need to migrate to a newer, event-based network status API. Synchronous getters are marked as PR #4008 should lay a foundation for this. |
That would be a good idea. |
That is correct. This should limit amount of queries greatly.
…On May 13, 2019 1:21:37 PM UTC, Tobias Kaminsky ***@***.***> wrote:
> a newer, event-based network status API.
That would be a good idea.
Do I understand this correct: every time we get a notification about a
network change we try to reach server and store this info.
We assume that the info is valid until a network change occurs again?
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#3947 (comment)
|
I started working on an event based network listener. |
I started working on it, but I need to consult you before I move forward. The check is called synchronously in few background operations. That means that whenever we run a remote op:
My initial simplistic approach was to simply wait for platform network status updates, but I see that this check is also verifying server availability by GET-ting I'm trying to understand:
The issues I see with it right now:
My proposed solution:
I'm not sure if our UX is ready for 3. @tobiasKaminsky @mario @AndyScherzinger Can you brainstorm this? |
We poke status.php to see if we're behind a walled garden on not pretty much. |
We use status.php for old (<NC13) or /index.php/204 for new ones to check if we can access the server.
In 2. we will get problems if user is connected to wifi, but not to internet (e.g. walled garden, or simply a local network)
Sorry, if I did not get your point, but why cannot we use event-based check: This way we do not have calls that often? |
@tobiasKaminsky this approach will not work, reason being that network change will not be trigger if for example your "walled garden" session timeouts. |
What kind of issues do we expect? I guess that the op will simply fail to be re-scheduled during next sync window. In comparision, what happens if we're in walled garden? If I understand the code correctly, op is aborted and re-scheduled. It looks for me like it's the same thing, except that we make 1 redundant call to Here is the pseudo-code of what I believe is happening:
I think we could do it a bit simpler:
I'm trying to understand what this means for the user. Is there any existing UX that depends on this status that we're at risk of breaking? This is exactly what I'm trying to avoid here - ie. UX regressions - but also I'm trying to figure out how much space for change we have.
Internet access might depend on other factors, such as acceptance of terms-of-service or delayed firewall updates In such case:
To mitigate 5. we'd need to poll the status again, which means we're back at square 1 or we risk random complaints of "doesn't-work-at-my-workplace-but-works-in-train"-type.
As you see above, we'd still need to call it often. We can throttle it of course, but:
This would not be reliable because "having network" and "having clear connection to server" are separate concepts and the latter one ("server") is not signalled asynchronously. We need to perform expensive polling again. Making polling less frequent makes it less and less reliable. I'd honestly rely on other mechanisms to handle that and treat "walled garden" simply as yet another random network issue. If app can recover from that gracefully, But I don;t know what UX relies on that |
Thanks for your very detailed answer!
On FDA we check result of sync and show matching info: android/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java Lines 1404 to 1423 in 1cb125a
Thanks for explaining why my idea is not working :-)
How could we recover gracefully from walled garden / no internet connection without polling to status.php/204? What about this
|
Currently we use connectivity check very often, but e.g. if the data connection did not changed, we do not have to check again.
Also it was reported that some users fire 6x status.php checks in a second:
The text was updated successfully, but these errors were encountered: