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.
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.onLineto detectofflinestatus is a good idea. Relying on it to detectonlinestatus is not.I suggest changing to reflect this, basically the logic would go like
!navigator.online ? definitelyOffline : pollToDetectOnlineIf 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.