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

Fixes: NullPointerException in BlazeViewModel #20716

Merged
merged 2 commits into from
Apr 25, 2024
Merged

Fixes: NullPointerException in BlazeViewModel #20716

merged 2 commits into from
Apr 25, 2024

Conversation

pantstamp
Copy link
Contributor

@pantstamp pantstamp commented Apr 25, 2024

Fixes #20644
This PR tries to fix the NullPointerException that is described on the above ticket.

To Test:

  1. Enable Developer options on your device
  2. Go to Developer Options → Background Process limit → Set 1 as background process limit
  3. Install a build from the trunk
  4. Go to Pages screen
  5. Pick a page and tap on the menu button (three dots menu)
  6. Tap on "Promote with Blaze"
  7. Wait for the blaze screen to load
  8. Move the app to background and use 2+ other apps
  9. Launch the app from app launcher
  10. Verify that you see the crash in your LogCat

FATAL EXCEPTION: main Process: com.jetpack.android.prealpha, PID: 17395 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jetpack.android.prealpha/org.wordpress.android.ui.blaze.blazepromote.BlazePromoteParentActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3822) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3963) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2468) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

  1. Check out this PR's branch
  2. Follow again steps 4-9
  3. Verify that you don't see the crash in your LogCat and you end up in the pages list screen

Regression Notes

  1. Potential unintended areas of impact

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

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

    • Relied on existing tests

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):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@pantstamp pantstamp requested a review from zwarm April 25, 2024 14:54
@dangermattic
Copy link
Collaborator

dangermattic commented Apr 25, 2024

1 Warning
⚠️ This PR is assigned to the milestone 24.8. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@pantstamp pantstamp added this to the 24.8 milestone Apr 25, 2024
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 25, 2024

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
Versionpr20716-dbffad1
Commitdbffad1
Direct Downloadjetpack-prototype-build-pr20716-dbffad1.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 25, 2024

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
Versionpr20716-dbffad1
Commitdbffad1
Direct Downloadwordpress-prototype-build-pr20716-dbffad1.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 40.63%. Comparing base (5efa916) to head (dbffad1).

Files Patch % Lines
...ss/android/ui/blaze/blazeoverlay/BlazeViewModel.kt 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #20716   +/-   ##
=======================================
  Coverage   40.62%   40.63%           
=======================================
  Files        1485     1485           
  Lines       68330    68336    +6     
  Branches    11302    11304    +2     
=======================================
+ Hits        27760    27765    +5     
  Misses      38054    38054           
- Partials     2516     2517    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@zwarm zwarm self-assigned this Apr 25, 2024
Copy link
Contributor

@zwarm zwarm left a comment

Choose a reason for hiding this comment

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

Works like a charm @pantstamp . 👍

@zwarm zwarm merged commit f8d99bd into trunk Apr 25, 2024
20 checks passed
@zwarm zwarm deleted the issue/20644 branch April 25, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException
4 participants