-
Notifications
You must be signed in to change notification settings - Fork 26
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: crash when saving bottom sheet state for message with reply [WPB-14433] #3689
fix: crash when saving bottom sheet state for message with reply [WPB-14433] #3689
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/candidate #3689 +/- ##
=====================================================
- Coverage 44.94% 44.91% -0.04%
=====================================================
Files 471 472 +1
Lines 15725 15757 +32
Branches 2686 2694 +8
=====================================================
+ Hits 7068 7077 +9
- Misses 7901 7924 +23
Partials 756 756
Continue to review full report in Codecov by Sentry.
|
Built wire-android-staging-compat-pr-3689.apk is available for download |
Quality Gate passedIssues Measures |
Built wire-android-staging-compat-pr-3689.apk is available for download |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
After fixing bottom sheet crashes with this PR: #3670, still bottom sheet for message with a reply crashes.
Causes (Optional)
Android Studio had some problems highlighting all models that need to be serialized so previous PR missed out some of them. Also, turns out that using multiple serializer types can lead to some problems (in this case it was Json and Bundlizer).
Solutions
Make all classes used by
UIMessage
serializable, to be 100% sure.Replace Any primitive type serializer that uses Json with a more custom one that does it via surrogate.
Wrap serialization in try-catch so that if it fails, the app doesn't crash and only the bottom sheet is hidden as there's no saved state for it.
Update: after the discussion, it was decided to drop saving the state for now and come up with some solution to not store too much, especially for conversations and messages to not keep such data unencrypted anywhere, so in the future when there's time to do that we could slim down the models for the bottom sheets to save only required data and not any sensitive ones. For now
rememberSaveable
is replaced with regularremember
so the bottom sheet won't be rebuilt and the only drawback would be that the user would need to open it again.Testing
Test Coverage (Optional)
How to Test
Open conversation, long-click on a message with a reply to open the bottom sheet and put the app into background.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.