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

onInternetConnectivityChanged event is called unexpectedly and with a wrong value #7812

Open
ShoaibEhsan1 opened this issue Mar 7, 2025 · 0 comments

Comments

@ShoaibEhsan1
Copy link

iTwin core provides functionality via overrideInternetConnectivity() so that the apps can control the behavior of internet connectivity. At the same time, it also calls this override function internally based on window.navigator.onLine check (in NativeApp.ts startup function). window.navigator.onLine is not a reliable check and thus it changes the connectivity status from what was set by the app earlier which leads to unwanted results.

Steps to reproduce the behavior:

  1. Listen to onInternetConnectivityChanged event In both frontend and backend in app
  2. disconnect from internet
  3. set the connectivity to Offline via overrideInternetConnectivity
  4. call itwin core startup
  5. if it determines navigator.onLine to true then it raises onInternetConnectivityChanged with Online status which is wrong.

Expected behavior
Just like overrideInternetConnectivity, iTwin core also provide a way to override connectivity check in the startup and should not determine connectivity state based on unreliable check.

  • iTwin.js Version [4.10.x]
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

1 participant