Skip to content
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

Move the code snippet which caused ANR to background thread #20833

Merged
merged 2 commits into from
May 16, 2024

Conversation

jarvislin
Copy link
Contributor

@jarvislin jarvislin commented May 16, 2024

Fixes #20832

This is an ANR issue, we fetched data from database in main thread in the class of site header.

This PR moves the code snippet which caused ANR to background thread by using ExecutorService, and then handles the UI related code in main thread with Handler.


To Test:

  1. Sign in JP app.
  2. Switch to the Notifications tab.
  3. Find a comment type notification and click on it.
  4. Click on user's avatar.
  5. It will navigate you to ReaderPostList.
  6. It should display the site header correctly.
  7. Done, thank you!

Screenshot_20240516-112830 (1)


Regression Notes

  1. Potential unintended areas of impact

    • reader
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • manual
  3. What automated tests I added (or what prevented me from doing so)

    • n/a

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

Skipped

@jarvislin jarvislin added Reader [Type] Bug [Type] ANR Application Not Responding labels May 16, 2024
@jarvislin jarvislin added this to the 25.0 milestone May 16, 2024
@jarvislin jarvislin marked this pull request as ready for review May 16, 2024 08:56
@jarvislin jarvislin requested a review from justtwago May 16, 2024 08:59
Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@wpmobilebot
Copy link
Contributor

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20833-03a7cbd
Commit03a7cbd
Direct Downloadjetpack-prototype-build-pr20833-03a7cbd.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20833-03a7cbd
Commit03a7cbd
Direct Downloadwordpress-prototype-build-pr20833-03a7cbd.apk
Note: Google Login is not supported on these builds.

Copy link
Contributor

@justtwago justtwago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix Jarvis! Works as expected 🚢

@justtwago justtwago merged commit a5d3ef1 into trunk May 16, 2024
21 of 24 checks passed
@justtwago justtwago deleted the fix/20832-anr-reader-blog-table branch May 16, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reader [Type] ANR Application Not Responding [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApplicationNotResponding: ANR
3 participants