Open ghost opened 3 years ago
@bezysoftware pls one minute of your attention, if possible
Exactly 1 hour?
In my case, when internet goes offline for some seconds, the extension starts to use high cpu and stops to detect realtime db downstream. my workaround was to dispose firebase subscription and restart it again.
I'm afraid I don't have a good solution. The library uses REST unlike the other official sdks which use their own protocol. Extending an auth token after the original one expired will cause all data to be re-fetched, as you observed, there is unfortunately no way to specify "last seen item" to skip the previous ones. There is an offline DB support within the library, but it's (by design, since it's fairly unstable and has some drawbacks) undocumented.
If I remember correctly proactively refreshing the token before it expires will not help either, because the token is part of the url used when opening the stream and I don;t think there is a way to extend it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
after an hour my stream stops listening
I have the same problem. 😪
Is there any solution yet?
@BenjamimRodrigo @nonpensavo @Unterable ?
There is an exception thrown after 1 hour. It's caused by the Auth token that expires exactly in 1 hour.
The event is there in the ProcessServerData:
case FirebaseServerEventType.AuthRevoked: break;
But as you see it does not do anything, even if it's clear that the server revoked the token. It should be added and event to shut down the processing thread and to signal this back. In fact, maybe there should be a status callback as well, not just a data update. This way you can do obtain a new auth token and restart the listening. Also, the same scenario applies if you loose the connection for whatever reason (like loss of internet connection).
I have exactly the same behavior, after 1 hour the stream doesn't receive any new updates. Any solution ?
I am using
SignInWithCustomTokenAsync()
and everything works fine except for fact that after around one hour it just stops receiving all subscribed events. I believe that can be related to a token being expired but it is supposed to still get subscribed events because token itself may be expired but the session should not have according to google documentationAnd for other SDKs, like iOS and Android, the same way, Realtime Database automatically handles the extension of a current session, and I was expecting, and trying to get similar flow. I tried to refresh the token every time its expired but that is similar to new sign in, loads up all the subscribed events and there are hundreds or thousands of duplicates every hour (for example chatting) and the gap between expiration and the refresh is missed completely until it is fetched after refresh and filtered out. Unless I spam it every second near to expiration. If Im using the library wrong way, pls let me know. Or should I just keep using it and ignore duplicates by filtering them out. I worry about huge possible load in memory every 60 minutes. I just want subscribed events keep coming until I dispose the subscription.
Debugging / testing this is even more uncomfortable that I have to wait 1 hour.. every time. So any help would be greatly appreciated..