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

Reset channel members and watchers states when fetching the initial state #3245

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

laevandus
Copy link
Contributor

🔗 Issue Links

Resolves ios-issues-tracking/issues/866

🎯 Goal

  • Reset members and watches when resetting the channel data to the initial state

📝 Summary

  • When we run synchronize then we should reset member data since members might have been removed
  • It was fixed for chat state layer and state layer has tests for this already.

🧪 Manual Testing Notes

  • Log in with Luke on device 1
  • Log in with Han on device 2
  • Luke creates a channel with Han
  • Han opens the channel and sees that they are both part of the channel
  • Han quits the demo app on device 2
  • Luke leaves the channel
  • Han launches the app again and navigates to the channel

What happens: Luke is shown as a member
Expected: Luke is not shown as a member for Han

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

@laevandus laevandus requested a review from a team as a code owner June 12, 2024 11:33
@laevandus laevandus added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Jun 12, 2024
Comment on lines -921 to -927
let parameter = channelQuery.pagination?.parameter
let reset = parameter == nil || parameter?.isJumpingToMessage == true
let actions = ChannelUpdateActions(
memberListSorting: memberSorting,
resetMembers: reset,
resetWatchers: reset
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the fix I used for state layer to the completion handler based update method instead. State layer already has tests for this case.

@testableapple testableapple added the 🟢 QAed A PR that was QAed label Jun 17, 2024
@laevandus laevandus merged commit 1acd971 into develop Jun 17, 2024
6 checks passed
@laevandus laevandus deleted the fix/invalid-member-state branch June 17, 2024 12:29
Copy link

sonarcloud bot commented Jun 17, 2024

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 🟢 QAed A PR that was QAed 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants