Skip to content

navigator.onLine false positives #83

@ash0x0

Description

@ash0x0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions