-
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: direct usage from Lazy<CoreLogic> (WPB-10304) 🍒 #3281
fix: direct usage from Lazy<CoreLogic> (WPB-10304) 🍒 #3281
Conversation
Signed-off-by: alexandreferris <[email protected]>
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3281 +/- ##
========================================
Coverage 44.55% 44.55%
========================================
Files 453 453
Lines 15198 15198
Branches 2527 2527
========================================
Hits 6772 6772
Misses 7708 7708
Partials 718 718
Continue to review full report in Codecov by Sentry.
|
Built wire-android-staging-compat-pr-3281.apk is available for download |
Built wire-android-dev-debug-pr-3281.apk is available for download |
Signed-off-by: alexandreferris <[email protected]> Co-authored-by: Alexandre Ferris <[email protected]>
This PR was automatically cherry-picked based on the following PR:
Original PR description:
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Getting this crash when opening and closing the app multiple times in a sequence:
Causes (Optional)
Although it looked like a circular dependency in the first instance, looking at the code and the crash error, it felt more like a direct trying access to
Lazy<CoreLogic
.My conclusion is that It was introduced from this PR : fix: inject usecases lazily in WireActivityViewModel (WPB-6874) by adding
CoreLogic
asLazy<CoreLogic>
You can check datadog from here:
DataDog All Errors
DataDog First Error
Solutions
Lazy<>
forCoreLogic
on these ViewModels:FeatureFlagNotificationViewModel
CommonTopAppBarViewModel
LegalHoldRequestedViewModel
LegalHoldDeactivatedViewModel
The reason the issue crashes on
LegalHoldRequestedViewModel
is because as soon asWireActivity
starts, it starts listening for legal hold status to show the dialog, thus invoking coreLogic when it needs a.get()
before or something was it was not initialized in time.Lazy<CoreLogic
fromWireActivityViewModel
.Testing
Test Coverage (Optional)
How to Test
Currently the only way to test (as from seeing from the ticket as well) is to open and close the app multiple times until there is a crash (but not very reliable).