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

Quick Start: Fix IllegalStateException #20654

Closed zwarm closed 4 weeks ago

zwarm commented 4 weeks ago

Fixes #20653

This PR addresses the potential for an IllegalStateException that can occur when updating from a background thread in the clearMenuStep(). The issue was due to invoking setValue() on _quickStartMenuStep directly, which throws an illegalStateException when called from the mainthread.

To resolve this issue, the clearMenuStep() function has been updated to use postValue() instead of setValue(). This ensures that the update to _quickStartMenuStep happens asynchronously on the main thread, preventing threading issues and IllegalStateExceptions.


To Test:

I was unable to recreate the crash, so the test validates all still works correctly.


Regression Notes

  1. Potential unintended areas of impact Quick start tutorial doesn't work as normal

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

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


PR Submission Checklist:


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

sonarcloud[bot] commented 4 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 4 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
Versionpr20654-f980e0d
Commitf980e0dd4f6b685a8fe0c09cb248b7276ce90473
Direct Downloadwordpress-prototype-build-pr20654-f980e0d.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 4 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
Versionpr20654-f980e0d
Commitf980e0dd4f6b685a8fe0c09cb248b7276ce90473
Direct Downloadjetpack-prototype-build-pr20654-f980e0d.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 40.13%. Comparing base (6ef913e) to head (f980e0d). Report is 25 commits behind head on trunk.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20654 +/- ## =========================================== - Coverage 82.58% 40.13% -42.45% =========================================== Files 15 1470 +1455 Lines 534 67909 +67375 Branches 50 11262 +11212 =========================================== + Hits 441 27255 +26814 - Misses 75 38171 +38096 - Partials 18 2483 +2465 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.