Fix channel list skipping some updates on iPad #1059
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
Fixes: IOS-1246
🎯 Goal
Fix channel list skipping some updates on iPad
📝 Summary
🛠 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
updatedChannelsFromMessageListis 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, notupdatedChannelsFromMessageListdoes 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:
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.
Note: unit test was added for optimised updates, no need to verify that manually.
☑️ Contributor Checklist
docs-contentrepo