-
Notifications
You must be signed in to change notification settings - Fork 868
Fix reactions summary crash #5472
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 reactions summary crash #5472
Conversation
bmarty
left a comment
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 (did not test it though)
| val onShowLessClicked: () -> Unit, | ||
| val onAddMoreClicked: () -> Unit | ||
| ) : Parcelable | ||
| ) |
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.
I though the idea was to avoid having lambda in data class. Anyway I understand why it should fix the crash.
On my side, I would have added a new sub interface to TimelineEventController.Callback, but I did not try to do so (this is maybe not better).
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.
I would be up for avoiding the bundle of functions by passing an interface instead (not a blocker for this PR from me)
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.
I Suspect the problem is due to the @Parcelize and not the data class. If the crash continue then we will change it with a callback.
I also tried with callback at first but then you would have to implement that callback on TimelineFragment and we don't want that there. I think this is a bit more clear with lamda
| eventsGroup = timelineEventsGroup | ||
| eventsGroup = timelineEventsGroup, | ||
| reactionsSummaryEvents = ReactionsSummaryEvents( | ||
| onAddMoreClicked = { reactionListFactory.onAddMoreClicked(callback, event) }, |
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.
I would avoid creating a new data class to be pass everywhere. Would prefer having ReactionsSummaryCallback as interface with empty default implementation. Then let TimelineEventController.Callback inherits this interface and just delegate to reactionListFactory in the case of onShowLess and onShowMore
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.
This was my first attempt. Let me check if I can enhance it fast for the release.
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.
thanks for the fix! 🤞 could be nice to avoid holding the callbacks in a data class, not a blocker for the release fix
EDIT - just seen @ganfra 's comment, will avoid merging until we're all aligned
We can change that later for not blocking the release :) |
The implementation with callbacks is not working as expected, so I will not submit the PR. Maybe I miss something feel free @ganfra or whoever to try it when you have some time. I would suggest to add the current solution to the release and check if the problem persist |
|
thanks for looking into it 👍 let's create a separate ticket to iterate on the area |
Fixing
NotSerializableExceptioncrash on reactions summaryCloses #5463