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

Cloud: When the device goes offline, the errors pile up. Can the cloud stop sync & ws connection when there is no internet? #1974

Open
oyalhi opened this issue May 1, 2024 · 2 comments

Comments

@oyalhi
Copy link

oyalhi commented May 1, 2024

As the title suggests. When we take the device offline, the errors start to pile up. So much so that chrome devtools becomes unresponsive and safari devtools connected to an actual device just crashes and closes.

Alternatively, is there a best practice we should be following when the device is offline in terms of dexie cloud?

ScreenShot 2024-05-01 at 08 10 53@2x

@oyalhi oyalhi changed the title Cloud: When the device goes offline, the errors pile up. Can the cloud stop ws connection and sync when there is no internet? Cloud: When the device goes offline, the errors pile up. Can the cloud stop sync & ws connection when there is no internet? May 1, 2024
@dfahlander
Copy link
Collaborator

I can repeat the following. Don't know if that corresponds to what you are experiencing...

  1. I open an application (dexie cloud todo sample app)
  2. Switch off my wifi connection
  3. Get the websocket error in the console only if I am active in the application and at most every 3rd second if I am constantly active with mouse or keyboard.
  4. If I stop being active (not use keyboard or mouse in application), error stops logging.
  5. If I start being active, error comes again but not more often than every 3rd second

To me this does not end up in some state that locks the application or goes into any endless loop. Is this the same in your case or do you experience more frequent logs than every 3rd second at most?

I am on a macbook with chrome devtools but I can't reproduce the devtools becoming unresponsive.

Could your situation be reproducable with your app and computer with chrome / devtools?

@oyalhi-mgm
Copy link

Just checked dexie cloud todo sample app. The behavior is very different than what I'm observing with our app.

It might be related to the 2 web workers we have. Without having any interaction we seem to get into endless loop. Not sure what's causing it. Workers are meant to run once on an update to a transaction. Our app is a PWA if that matters.

Here is a short video showing the error, around 29second mark after we update a record issue is more observable: https://share.cleanshot.com/zVy77NTX

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