-
Notifications
You must be signed in to change notification settings - Fork 195
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Message List Data Source Decorator #3247
base: develop
Are you sure you want to change the base?
Conversation
Generated by 馃毇 Danger |
StreamChat XCMetrics
|
|
@@ -21,6 +21,10 @@ open class ChatMessageListVC: _ViewController, | |||
UIGestureRecognizerDelegate, | |||
VoiceRecordingAttachmentPresentationViewDelegate | |||
{ | |||
open var dataSourceDecorator: (([ChatMessage]) -> [ChatMessage])? = { |
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.
shouldn't we return nil
as default? This will filter system messages in the SDK.
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.
Yes, yes, I'm just testing this to see if Firebase Performance Metrics has any impact or not
listView.currentMessagesFromDataSource = messages | ||
listView.newMessagesSnapshot = messages | ||
if let dataSourceDecorator { | ||
let filteredMessages = dataSourceDecorator(Array(messages)) |
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.
the benchmark tests are failing, maybe good to run them again.
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.
Yes, that is the plan, thats why I'm adding a default decorator
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.
That line should be fine since we have background mapping enabled and if it is enabled, LazyCachedMapCollection maps all the items in the init. No performance hit here.
StreamChat XCMetrics
|
StreamChat XCMetrics
|
馃敆 Issue Links
N/A
馃幆 Goal
Possibility of overriding the data source in the message list.
Potential edge cages:
1- If all messages from the first page are removed (unlikely), loading more messages is impossible.
2- If from the first 25 messages, only 1 or 2 are filtered, then it will feel like there are no more pages, but there is.
3- The preview message in the CHannel list might not be in sync if last message from the message list is removed
馃摑 Summary
Provide bullet points with the most important changes in the codebase.
馃洜 Implementation
Provide a detailed description of the implementation and explain your decisions if you find them relevant.
馃帹 Showcase
Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.
馃И Manual Testing Notes
Explain how this change can be tested manually, if applicable.
鈽戯笍 Contributor Checklist
馃巵 Meme
Provide a funny gif or image that relates to your work on this pull request. (Optional)