-
Notifications
You must be signed in to change notification settings - Fork 136
Fix order details crash on rotation #13257
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
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #13257 +/- ##
=========================================
Coverage 40.67% 40.67%
Complexity 6396 6396
=========================================
Files 1351 1351
Lines 77664 77664
Branches 10682 10682
=========================================
Hits 31587 31587
Misses 43291 43291
Partials 2786 2786 ☔ View full report in Codecov by Sentry. |
irfano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It no longer crashes on tablets or phones, and I couldn’t find any drawbacks to this solution. LGTM! 👍🏻
Description
In this PR for Bulk Order Status Update project, we added a mechanism to save selected items and restore it during configuration change.
This creates a crash in a case in this situation:
What happens here is that
bindingbecomes null when navigating to Order Details butOrderListFragmentis still active, so when the call forbindingis done inonSaveInstanceState, it creates a crash.This PR adds null check to prevent that crash. I also added similar check in
onViewStateRestoredfor extra safety, and a small fix inOrderSelectionItemKeyProviderthat came from Android Studio's suggestion.Steps to reproduce
TC1:
TC2: ensure bulk selection still work
Testing information
n/a
The tests that have been performed
I tested both TCs in phone mode as that's where the crash happens. In tablet the case is a bit different (Order List and Details appear all the time in two panel mode) and the crash does not happen in my check.
Images/gif
n/a
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: