PubSub messaging breaks on user logout

Hi @Hrvoje_Ditrih

After logout and then login, there are few seconds after Beckendless connects.

It’s strangely big delay. The delay between disconnect and reconnect events for us is few hundred of milliseconds.

If you add/remove message listners in a period when Backendless still isn’t connected they won’t work.

We cannot reproduce this case. If we add listeners before socket is reconnected, they works correctly. Would be great if you create minimal reproducible example with this issue and share it.

There are numerous issues when using login/logout.

RT connection uses user token that is why login\logout events and rt listeners are linked. And we are glad you’ve discovered this issue and helped us to resolve it.

Our temporary fix for this situation is that when the user wants to logout we quit the app after logout.

I agree, this is very rough workaround. If you are not sure about RT stability you can just remove and then re-add all necessary listeners after logout by yourself. There is no need to restart whole app.

Best Regards,
Maksym

It’s strangely big delay. The delay between disconnect and reconnect events for us is few hundred of milliseconds.

Well for us it is a second or more. Our requests for Backendless API Services on CloudCode take 2-3 seconds sometimes. It could be because we are in Europe and Backendless servers are in US.

We cannot reproduce this case. If we add listeners before socket is reconnected, they works correctly. Would be great if you create minimal reproducible example with this issue and share it.

I already did. @olhadanylova has the source code and here is the post.

I agree, this is very rough workaround. If you are not sure about RT stability you can just remove and then re-add all necessary listeners after logout by yourself. There is no need to restart whole app.

We tried everything: adding/removing listeners, joining/leaving channels, tried adding/removing/joining/leaving at every possible time point of Backendless lifecycle. But it still wouldn’t work sometimes. It only works when the user is already logged in on app startup or when user logs in after the fresh app startup.

We were able to finally reproduce this issue. I’ve updated the internal ticket BKNDLSS-23739. We will keep you with a progress of this task.

Backendless has a cluster in Europe too:

Regards,
Mark

Hi @mark-piller,

We know. But we made Backendless app before you had European cluster.

Hi, @Hrvoje_Ditrih

If you would like, we can always change the hosting zone. The process takes about 3-4 hours. Application ID and API keys won’t change, however the api endpoint will change from api.backendless.com to eu-api.backendless.com. Also, this will coast additional fee to cover engineer’s time.

Regards, Marina

Hello @Hrvoje_Ditrih,

Sorry for the delay and thank you for your patience. Unfortunately the RT logic sometimes can be a little confusing and it may cause some issues.
A new version 6.3.1 is released. Could you please check? For me it works fine now and listners added while Backendless isn’t connected should work fine.

Regards,
Olha