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 editpost background issue #20702

Closed pantstamp closed 3 weeks ago

pantstamp commented 3 weeks ago

Fixes https://github.com/wordpress-mobile/WordPress-Android/issues/20667

There are instances in which the Edit Post view is not visible on return from background. The issue is hard to replicate and to date, have had a single developer able to reproduce this. As such, it's been difficult to find a fix.

This PR updates EditPostActivity.retrieveSavedInstanceState to use supportFragmentManager instead of fragmentManager while retrieving the EditorFragmentAbstract from the savedInstanceState bundle.

There is another change that I am contemplating, switching from FragmentPagerAdapter to FragmentStatePagerAdapter; however lifecycle management is a little different and I don't want to risk introducing other issues without fully thinking it through. I had switched it in the branch, but removed the change with the submitted PR.


To Test:


Regression Notes

  1. Potential unintended areas of impact Edit post doesn't return from background correctly

  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) N/A


PR Submission Checklist:


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

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
Versionpr20702-f005745
Commitf005745806a203334a555cd6b85cf82e215a9a81
Direct Downloadjetpack-prototype-build-pr20702-f005745.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
Versionpr20702-f005745
Commitf005745806a203334a555cd6b85cf82e215a9a81
Direct Downloadwordpress-prototype-build-pr20702-f005745.apk
Note: Google Login is not supported on these builds.
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

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 82.58%. Comparing base (2aa491b) to head (f005745). Report is 2 commits behind head on release/24.7.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/24.7 #20702 +/- ## ================================================= + Coverage 40.46% 82.58% +42.12% ================================================= Files 1484 15 -1469 Lines 68417 534 -67883 Branches 11308 50 -11258 ================================================= - Hits 27682 441 -27241 + Misses 38233 75 -38158 + Partials 2502 18 -2484 ```

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