-
Notifications
You must be signed in to change notification settings - Fork 193
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicated watching channel calls when reconnecting #3187
Merged
nuno-vieira
merged 6 commits into
develop
from
fix/triggering-duplicated-watching-channel-calls-when-reconnecting
May 9, 2024
Merged
Fix duplicated watching channel calls when reconnecting #3187
nuno-vieira
merged 6 commits into
develop
from
fix/triggering-duplicated-watching-channel-calls-when-reconnecting
May 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nuno-vieira
added
馃悶聽Bug
An issue or PR related to a bug
馃寪聽SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
labels
May 8, 2024
nuno-vieira
changed the title
Fix triggering duplicated watching channel calls when reconnecting
Fix duplicated watching channel calls when reconnecting
May 8, 2024
StreamChat XCMetrics
|
laevandus
approved these changes
May 9, 2024
martinmitrevski
approved these changes
May 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find 馃憣
nuno-vieira
deleted the
fix/triggering-duplicated-watching-channel-calls-when-reconnecting
branch
May 9, 2024 10:25
Merged
I manually verified |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
馃悶聽Bug
An issue or PR related to a bug
馃寪聽SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃敆 Issue Links
Resolves https://github.com/GetStream/ios-issues-tracking/issues/800
馃幆 Goal
Fix having duplicated watching channel calls after reconnection logic.
Context: Whenever we reconnect, if the user is watching channels, we track these channels and re-watch them.
馃摑 Summary
This was because we were incorrectly adding a channel controller to
activeChannelControllers
whenever we created a controller. This is wrong; we should only add it when we call synchronize or start watching a channel. Only in this scenario do we need to track a channel.Besides this, we did not control whether we already had a channel in the
activeChannelControllers
. So, there were cases where we had duplicated active channel controllers, and whenever a reconnection happened, it would trigger duplicated watch calls.Lastly, even if a channel is open, if the customer stops watching the channel, it should not be in the
activeChannelControllers
. This was also missing.馃И Manual Testing Notes
1- Open Proxyman
2- Open Demo App Configuration and setup token refresh with 15s
3- Open the Channel List
4- Wait for reconnection
5- No channel query call should be made (Do not confuse with channel list call)
6- Open and close a few channels
7- 4. and 5.
8- Open a channel, and remain open
9- When reconnecting the a watch call should be made for the open channel
鈽戯笍 Contributor Checklist