-
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) #3279
fix: direct usage from Lazy<CoreLogic> (WPB-10304) #3279
Conversation
Signed-off-by: alexandreferris <[email protected]>
Signed-off-by: alexandreferris <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/candidate #3279 +/- ##
==================================================
Coverage 44.56% 44.56%
==================================================
Files 453 453
Lines 15188 15188
Branches 2522 2522
==================================================
Hits 6768 6768
Misses 7702 7702
Partials 718 718
Continue to review full report in Codecov by Sentry.
|
Quality Gate passedIssues Measures |
Built wire-android-staging-compat-pr-3279.apk is available for download |
Built wire-android-internal-compat-pr-3279.apk is available for download |
Signed-off-by: alexandreferris <[email protected]>
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).