-
Notifications
You must be signed in to change notification settings - Fork 210
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
Archiving channels for the current user #3524
Conversation
SDK Size
|
SDK Performance
|
Generated by 🚫 Danger |
SDK Size
|
39a7ad7
to
3fdd3e9
Compare
3fdd3e9
to
c1be0da
Compare
c1be0da
to
c55f8c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅ Same comment about adding it to SwiftUI
Quality Gate passedIssues Measures |
🔗 Issue Links
Part of IOS-553
🎯 Goal
Add a new feature enabling users to archive channels (archived status is tied to the user, not a global action)
📝 Summary
Chat.archive(scope:)
andChat.unarchive(scope:)
ChatChannelController.archive(scope:completion:)
andChatChannelController.unarchive(scope:completion:)
ChannelArchivingScope
with only one supported option ofme
(archiving the channel for everyone is not supported)FilterKey.archived
for filtering channel listsChatChannel.membership.archivedAt
ChatChannel.isArchived
archived_at
in member payloadsarchive: true
with theMemberUpdatePayload
type or unsettingarchived
🛠 Implementation
Archiving and unarchiving works by calling partial update on the chat channel member (current user) and setting either
archived: true
or unsetting it. Therefore, one could also useChatChannelMemberController.partialUpdate(extraData:unsetProperties:completion:)
where the user if is the current user id and extra data is["archived": .boolean(true)]
or unsetProperties is set to["archived"]
. New high-level archive and unarchive methods end up calling the same member updater's code, just make it more natural and discoverable.Note: Archiving is per user. Meaning that if user A archives an channel with user B, then user B does not see it archived.
🧪 Manual Testing Notes
Archiving and unarchiving
Result: Nothing happens because default channel list includes archived channels
Result: archived channel is shown
Result: channel list is empty
Filtering archived channels
Open DemoAppCoordinator+DemoApp.swift:L98 and change the initial channels query to:
Result: Channel is removed because we filter out archived channels
Result: Archived channel is shown
Result: Channel list is empty
☑️ Contributor Checklist