wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Fix null `siteModel` crash on the posts list screen #20683

Closed irfano closed 2 weeks ago

irfano commented 3 weeks ago

Fixes #20534

This aims to address a crash that started 5 years ago and was previously attempted to be fixed (with https://github.com/wordpress-mobile/WordPress-Android/pull/13171).

I couldn't reproduce the crash, but I'm implementing the suggestion made in https://github.com/wordpress-mobile/WordPress-Android/pull/13171#issuecomment-712938324.

Using PendingIntent.FLAG_ONE_SHOT and PendingIntent.FLAG_UPDATE_CURRENT together may not work properly, so I believe this change will resolve the crash.


To Test:

I don't know how to reproduce this issue but you can test starting posts list from the notification.

  1. Ensure notification permission is allowed.
  2. Add a video to a post.
  3. Publish and put the app into the background just after publishing the post.
  4. Verify that you received a "post published" notification and that it opens the posts list.
test notification video https://github.com/wordpress-mobile/WordPress-Android/assets/2471769/176a97ef-f14f-4c29-84d2-549b48fae486

Regression Notes

  1. Potential unintended areas of impact

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

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

    • Since I couldn't reproduce the crash, adding automated tests is not proper.

PR Submission Checklist:


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

sonarcloud[bot] commented 3 weeks ago

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

wpmobilebot commented 3 weeks ago
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
Versionpr20683-96d3a69
Commit96d3a6935d89432b0f9f6a17369cf861e2980bad
Direct Downloadjetpack-prototype-build-pr20683-96d3a69.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 3 weeks ago
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
Versionpr20683-96d3a69
Commit96d3a6935d89432b0f9f6a17369cf861e2980bad
Direct Downloadwordpress-prototype-build-pr20683-96d3a69.apk
Note: Google Login is not supported on these builds.