FIX: correctly resubscribe after restart (#21891)

Few weeks ago we implemented `onPresenceChangeCallback` to re-sync chat channels state when going back to a long time inactive tab. This codepath however contained a bug as we were reseting all subscriptions but only restarting global subscriptions and not per channel subscriptions.

This commit should correctly ensure we correctly do so. It's sadly very hard to test time related changes in system specs.

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
This commit is contained in:
Joffrey JAFFEUX 2023-06-01 19:00:54 +02:00 committed by GitHub
parent 1d9f195207
commit 676b558265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ export default class ChatSubscriptionsManager extends Service {
restartChannelsSubscriptions(messageBusIds) {
this.stopChannelsSubscriptions();
this.startChannelsSubscriptions(messageBusIds);
(this.chatChannelsManager.channels || []).forEach((channel) => {
this.startChannelSubscription(channel);
});
}
startChannelsSubscriptions(messageBusIds) {