Skip to content

Conversation

@ariskotsomitopoulos
Copy link
Contributor

Fixing NotSerializableException crash on reactions summary

Closes #5463

@ouchadam ouchadam changed the base branch from develop to release/v1.4.4 March 9, 2022 10:58
Copy link
Member

@bmarty bmarty left a 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
)
Copy link
Member

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).

Copy link
Contributor

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)

Copy link
Contributor Author

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

@ouchadam ouchadam added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Mar 9, 2022
eventsGroup = timelineEventsGroup
eventsGroup = timelineEventsGroup,
reactionsSummaryEvents = ReactionsSummaryEvents(
onAddMoreClicked = { reactionListFactory.onAddMoreClicked(callback, event) },
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor

@ouchadam ouchadam left a 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

@ganfra
Copy link
Member

ganfra commented Mar 9, 2022

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 :)

@github-actions
Copy link

github-actions bot commented Mar 9, 2022

Unit Test Results

  96 files  ±0    96 suites  ±0   1m 22s ⏱️ +4s
172 tests ±0  172 ✔️ ±0  0 💤 ±0  0 ±0 
564 runs  ±0  564 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 84b3f63. ± Comparison against base commit 104f948.

@ariskotsomitopoulos
Copy link
Contributor Author

ariskotsomitopoulos commented Mar 9, 2022

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

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

@ouchadam
Copy link
Contributor

ouchadam commented Mar 9, 2022

thanks for looking into it 👍 let's create a separate ticket to iterate on the area

@ouchadam ouchadam merged commit 57ffc56 into release/v1.4.4 Mar 9, 2022
@ouchadam ouchadam deleted the feature/aris/fix_5463_parcelising_reaction_crash branch March 9, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-NextRelease For issues and PRs which should be included in the NextRelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash - Parcelising ReactionsSummaryData

5 participants