-
Notifications
You must be signed in to change notification settings - Fork 28
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: NotificationChannelGroup crash (WPB-6233) #2691
fix: NotificationChannelGroup crash (WPB-6233) #2691
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2691 +/- ##
===========================================
- Coverage 43.02% 43.01% -0.02%
===========================================
Files 408 408
Lines 13525 13527 +2
Branches 2393 2393
===========================================
- Hits 5819 5818 -1
- Misses 7021 7024 +3
Partials 685 685
Continue to review full report in Codecov by Sentry.
|
APKs built during tests are available here. Scroll down to Artifacts! |
Build 3072 succeeded. The build produced the following APK's: |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 3085 failed. |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 3197 succeeded. The build produced the following APK's: |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 3203 succeeded. The build produced the following APK's: |
Cherry pick from the original PR:
kalium
What's new in this PR?
Issues
crash:
https://play.google.com/console/u/2/developers/7098984309886892484/app/4973241010395499500/vitals/crashes/cb7ccba8c13d0a497df6edf45962bb4f/details?days=7&isUserPerceived=true
Causes (Optional)
Logs says that app is trying to create a NotifcationChannel in a NotifcationChannelGroup that doesn't exist. This looks strange as we create Group first and only after it create channels in that group.
So it's hard to reproduce the crash.
From the logs in DataDog found out that at least some part of the crashes happens after logout.
AND deleting the NotifcationChannelGroup is called from a few places (basically on logout) and launched in a separate CoroutineScope.
So there is a theory that when user logs out, gets invalid data first (list of users with logged out user) and after some time - valid data. This makes the app create notification group and channels for the user who is logged out. And somewhere during this in another CoroutineScope is called.
Solutions
Move calling into the same CoroutineScope to escape such conflicts.
For that update to not just create Groups and Channels for active users, but also remove the Groups and Channels that don't belong to any active user.