Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel was sometimes not selected when setting selectedChannelId #611

Merged
merged 12 commits into from
Oct 3, 2024

Conversation

laevandus
Copy link
Contributor

@laevandus laevandus commented Sep 30, 2024

🔗 Issue Link

Resolves: PBE-6078

🎯 Goal

Fix an issue where creating the channel list view with selectedChannelId set to a channel created a moments ago, did not select it.

🛠 Implementation

If there are integrations where a separate backend is used for creating channels and API responses contain cids, then immediately creating a channel list view and setting the selected id might fail. SDK needs to receive a web-socket event which triggers channel list change (calling synchronize can be too soon as well). Therefore, this PR changes the way how we try to set selected channel to waiting channel list updates instead. Moreover, it clarifies that the selectedChannelId method only works for loaded channels and it might be better to use ChannelViewScreen instead when it is certain that the channel is not part of the loaded list.

🧪 Testing

Since the issue is around timing with other backend APIs, it is hard to manually test.

☑️ Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Affected documentation updated (docusaurus, tutorial, CMS (task created)

…annelId was set to a channel created a moments ago
@laevandus laevandus added bug Something isn't working swiftui-repo labels Sep 30, 2024
@laevandus laevandus requested a review from a team as a code owner September 30, 2024 07:35
@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Sep 30, 2024

SDK Size

title develop branch diff status
StreamChatSwiftUI 7.14 MB 7.14 MB +1 KB 🟢

@laevandus laevandus enabled auto-merge (squash) October 1, 2024 06:40
Copy link

sonarcloud bot commented Oct 3, 2024

@laevandus laevandus enabled auto-merge (squash) October 3, 2024 08:51
@laevandus laevandus merged commit daa05d6 into develop Oct 3, 2024
11 checks passed
@laevandus laevandus deleted the fix/channel-selection branch October 3, 2024 09:12
@Stream-SDK-Bot Stream-SDK-Bot mentioned this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swiftui-repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants