Part-1: Compiler Warnings as Errors - WordPress Module - FragmentManager #19471
Part-1: Compiler Warnings as Errors - WordPress Module - FragmentManager #19471antonis merged 12 commits intowordpress-mobile:trunkfrom
Conversation
|
Thank you for stepping forward to help with this issue @07jasjeet 🙇 I've started by triggering the CI tests and noticed the following minor checkstyle issues. You can find some information on how to run those checks locally here |
Checkstyle complaint resolved.
antonis
left a comment
There was a problem hiding this comment.
Hey @07jasjeet 👋
Thanks again for picking this up. I've started testing the changes today and noticed a crash with the PrivateAtCookieRefreshProgressDialog when triggered from the ReaderPostDetailFragment. You can find some details on my testing below. In some cases I tweaked the app in debug mode for my tests since reproducing the exact conditions when the specific screens appear might be difficult.
- WPMainActivity
- StatsMinifiedWidgetConfigureFragment (Jetpack app flavour)
- Tested by adding a new mini widget (the first one) on the home screen
- StatsWidgetConfigureFragment (Jetpack app flavour)
- Tested by adding a new widget on the home screen
- AppRatingDialog
- Triggered in
WPMainActivity - Tested by tweaking the conditions here and here.
- PrivateAtCookieRefreshProgressDialog:
- Triggered in:
- [✓]
WPWebViewActivity: Tested by changing the condition here and using theGoogle Domains>Transfer your domains (Jetpack app flavour)option from the home screen - [✓]
EditPostActivity: Tested by tweaking the condition here and creating a new post. - [X]
ReaderPostDetailFragment(Jetpack app flavour): I tried forcibly showing the dialog by tweaking the if statement here and opening a reader post details and got the following exception.
- [✓]
java.lang.IllegalStateException: Fragment PrivateAtCookieRefreshProgressDialog{dbd370d} (d24e5cc0-9ff2-4557-b509-28cd1c11622d tag=private_at_cookie_progress_dialog) declared target fragment ReaderPostDetailFragment{ebcab11} (4ff3faff-6c67-4862-bb43-9ca97331fb16 id=0x7f0a0ba9) that does not belong to this FragmentManager!
at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:441)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:254)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1901)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1825)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1762)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
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)
Also feel free to add test instructions at the description of the PR 🙇
@antonis Fixed! |
WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostDetailFragment.kt
Outdated
Show resolved
Hide resolved
antonis
left a comment
There was a problem hiding this comment.
Thank you for the changes @07jasjeet 🙇
I've retested the PrivateAtCookieRefreshProgressDialog and everything worked for me:
-
WPWebViewActivity -
EditPostActivity -
ReaderPostDetailFragment
The code changes also look good 🎉
Apart from the minor detekt issue I reported all look good :)
antonis
left a comment
There was a problem hiding this comment.
Awesome work @07jasjeet 🏅
Everything looks goos on my side 🎉
Partially #17253 (Sub-ticket of #17246)
Replaced deprecated
fragmentManagerAPI withparentFragmentManagerorchildFragmentManagerwhich are direct recommended replacements for above mentioned deprecated API.This replacement required migration of
AppRatingDialogfromandroid.app.DialogFragmenttoandroidx.fragment.app.DialogFragmentand hence it is done so.Regression Notes
Potential unintended areas of impact
Mostly none because the newer API's are a direct replacement.
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual Testing
What automated tests I added (or what prevented me from doing so)
None
PR submission checklist:
RELEASE-NOTES.txtif necessary.UI Changes testing checklist: