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

Fix member list not updated after moderator is demoted #3132

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Apr 8, 2024

🔗 Issue Links

Resolves https://github.com/GetStream/ios-issues-tracking/issues/785

🎯 Goal

Fix the member list not updated after the moderator is demoted.

📝 Summary

At the moment, the backend does not fire any event to notify that a moderator has been demoted or promoted. So, if we have a moderator in the local DB that was demoted, it won't be removed from the local DB, so it will never be deleted.

🛠 Implementation

Even if the backend does not fire any event, we should also make sure that when opening the member list for the first time, that we clear the cache, to make sure that removed members do not get included in the response.

🧪 Manual Testing Notes

Note: Make sure you have the latest update of stream-cli on your machine.

  1. Add moderators to a channel through the CLI, example:
    stream-cli chat promote-moderators --type messaging --id 2884427A-E r2-d2 leia_organa
  2. Open the Demo App
  3. Swipe the channel and tap on "..."
  4. Then tap on "Show Channel Moderators"
  5. You should see the added moderators
  6. Go back to the Channel List
  7. Demote one of the moderators:
    stream-cli chat demote-moderators --type messaging --id 2884427A-E leia_organa
  8. Open the channel moderators again
  9. You should only see "r2-d2"

☑️ 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)

@nuno-vieira nuno-vieira added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Apr 8, 2024
@nuno-vieira nuno-vieira requested a review from a team as a code owner April 8, 2024 11:41
@nuno-vieira nuno-vieira changed the title Fix member list not updated after moderator is demoted Fix member list not updated after moderator is demoted/promoted Apr 8, 2024
@nuno-vieira nuno-vieira changed the title Fix member list not updated after moderator is demoted/promoted Fix member list not updated after moderator is demoted Apr 8, 2024
@nuno-vieira nuno-vieira enabled auto-merge (squash) April 8, 2024 14:59
@testableapple testableapple added 🤞 Ready For QA A PR that is Ready for QA 🟢 QAed A PR that was QAed and removed 🤞 Ready For QA A PR that is Ready for QA labels Apr 8, 2024
Copy link
Contributor

@testableapple testableapple left a comment

Choose a reason for hiding this comment

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

LGTM 🙌

@nuno-vieira nuno-vieira enabled auto-merge (squash) April 8, 2024 15:18
Copy link

sonarcloud bot commented Apr 8, 2024

@nuno-vieira nuno-vieira merged commit d2e1e59 into develop Apr 8, 2024
15 checks passed
@nuno-vieira nuno-vieira deleted the fix/member-list-query-with-moderators-not-updated-when-removed branch April 8, 2024 15:35
This was referenced Apr 8, 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

4 participants