Realtime subscriptions can fail silently in WebGL builds #5
xavier-ateo
started this conversation in
General
Replies: 1 comment
-
|
It might be the browser. There is a retry mechanism, but if the disconnect callback is not triggered, the retry will not be triggered either. I tested the manual disconnection on my side and it is working. Would be great if you can test it to :). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that realtime subscriptions can fail silently in WebGL builds.
When I leave the tab (which runs the Unity build) in the background for a while and come back to it, the subscriptions no longer trigger. When I check the logs, I can see that the disconnect callbacks were never triggered.
I suspect that either the browser, PocketBase, or my router drops the connection after it has been idle for too long, and that the Unity-side code is effectively "paused," preventing the disconnect callback from firing.
My workaround for this, at least for now, is to have a MonoBehaviour that tracks all active realtime subscriptions and first unsubscribes and then resubscribes to them when the application regains focus. It’s a bit of a hack, but it works.
Beta Was this translation helpful? Give feedback.
All reactions