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

navigator.onLine false positives #83

Open
ash0x0 opened this issue Apr 21, 2021 · 3 comments
Open

navigator.onLine false positives #83

ash0x0 opened this issue Apr 21, 2021 · 3 comments

Comments

@ash0x0
Copy link

ash0x0 commented Apr 21, 2021

The component currently fails to detect offline status reliably and produces many false positives.
From the navigator.onLine doc: while you can assume that the browser is offline when it returns a false value, you cannot assume that a true value necessarily means that the browser can access the internet.

Relying on navigator.onLine to detect offline status is a good idea. Relying on it to detect online status is not.
I suggest changing to reflect this, basically the logic would go like !navigator.online ? definitelyOffline : pollToDetectOnline

If that makes sense, I can PR this. I understand there's a concern with the polling volume and we don't want to be wasteful but as it currently is, there are tons of false positive conditions.

@cwise89
Copy link
Owner

cwise89 commented May 27, 2021

Hey @ash0x0 We have logic that determines the Browser being used in the user agent. This should prevent any false positives like you are mentioning as they all have different definitions of "online". Can you share a sandbox or example of the false positives ? Particularly , what user agent is causing the false positives?

@ash0x0
Copy link
Author

ash0x0 commented May 27, 2021

For me it was electron 12, which is chromium 89. Not sure if electron 13 has the same problem but 11 certainly does.

@BradPrit09
Copy link

BradPrit09 commented Sep 28, 2021

@ash0x0 It may be the issue of the object's state mutation.

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

No branches or pull requests

3 participants