Skip to content

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
@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
@laevandus laevandus disabled auto-merge October 3, 2024 08:04
Copy link

sonarqubecloud 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants