Skip to content

Conversation

@laevandus
Copy link
Contributor

@laevandus laevandus commented Nov 27, 2025

🔗 Issue Links

Fixes: IOS-1246

🎯 Goal

Fix channel list skipping some updates on iPad

📝 Summary

  • Remove queued updates array which can be stale when channels are updating often

🛠 Implementation

Channel list view model has optimised channel list updates implemented. The logic is that when channel is selected or search is displayed, updates are not applied to the channel list, when selection is reset, then queued channels are applied (simplified description). Problem is that the queued channels array can get out of sync due to if logic in handle channels changed. Moreover, another downside is that split view should make sure that updatedChannelsFromMessageList is true, otherwise updates are skipped although channel list is visible while channel is selected. It felt a bit too complex and I tried to simplify this by always reading channels from the controller and using just a bool for optimised state. Also, not updatedChannelsFromMessageList does not need to be set to true on iPad because the logic checks if split view config is true or false.

🎨 Showcase

🧪 Manual Testing Notes

Run demo app on iPad:

  1. Select a channel on A
  2. Use another simulator to trigger channel list updates for A
  3. A sees that channels update

Run demo app on iPad again, but set iPad split view config to false and updateChannelsFromMessageList to false as well which changes the navigation view to use stacked style like on iPhone.

let config = MessageListConfig(updateChannelsFromMessageList: false, iPadSplitViewEnabled: false)
        streamChat = StreamChat(chatClient: chatClient, utils: Utils(messageListConfig: config))
  1. Select a channel on A
  2. Use another simulator to trigger channel list updates for A
  3. A sees that channels are up to date after navigating back to the channel list

Note: unit test was added for optimised updates, no need to verify that manually.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus requested a review from a team as a code owner November 27, 2025 09:12
@github-actions
Copy link

Public Interface

🚀 No changes affecting the public interface.

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChatSwiftUI 9.68 MB 9.68 MB 0 KB 🟢

@sonarqubecloud
Copy link

@Stream-SDK-Bot
Copy link
Collaborator

StreamChatSwiftUI XCSize

Object Diff (bytes)
ChatChannelListViewModel.o -42

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅ Let's wait for the customer QA to merge this one 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants