-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Weekly Updates: Fix crash caused by modifying the UI from a background thread #20275
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
Weekly Updates: Fix crash caused by modifying the UI from a background thread #20275
Conversation
Generated by 🚫 dangerJS |
|
@mokagio FYI 🙇 |
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
momo-ozawa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described 👍
when checking if JP features are enabled
02ba486 to
1724d71
Compare
|
@hassaanelgarem @momo-ozawa just a note to say that I rewrote the history on this branch in order to base it on top of the new This is something I discussed with @hypest just a few hours ago and the intent is to preserve attribution. With this approach, the PR that will land in the hotfix branch will have been created by @hassaanelgarem as opposed to the usual ad-hoc PR I would create to cherry pick. This is the first time I try this approach and, apart from the rewriting of history of someone else's branch which always feels odd, I think it's working alright. Keen to know what you think. For review reference, I pushed a backup of the original history. We can use it to compare the diff of that version against |
|
I'll merge this as soon as CI gives the okay then move on with the hotfix deployment. For the record, I verified the fix behavior on top of 21.8.1 via:
|
Fixes #20266
Description
The crash is caused by calling
JetpackNotificationMigrationService.shared.shouldPresentNotifications()from a background thread. This gets triggered by the weekly roundup Background Processing task. This PR fixes this crash by avoiding the call toRootViewCoordinator.sharedwhen assessing if JP features are enabled or not from a background thread.Testing Instructions
trunkP.S: If the app is left running, it might crash due to the workaround done to reproduce the crash. The workaround results in us repeatedly initializing
RootViewCoordinator, which can eventually lead to a different crash.Regression Notes
Potential unintended areas of impact
Jetpack features removal
What I did to test those areas of impact (or what existing automated tests I relied on)
Manually tested going back and forth from the normal phase, phase 4, and new users phase.
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txtif necessary.