-
Notifications
You must be signed in to change notification settings - Fork 137
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
Handle crash in Bulk Order Update when item position is -1 #13359
Conversation
cfe5417
to
2d4a970
Compare
📲 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 @@
## release/21.4 #13359 +/- ##
===============================================
Coverage 40.80% 40.80%
Complexity 6411 6411
===============================================
Files 1353 1353
Lines 77679 77678 -1
Branches 10692 10692
===============================================
Hits 31698 31698
+ Misses 43172 43171 -1
Partials 2809 2809 ☔ View full report in Codecov by Sentry. |
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.
Changes look good and make sense, I tested the feature and didn't notice any regression, thanks for the quick fix @hafizrahman
Closes: #13358
Description
I can't reproduce the issue reported in the linked Sentry issue. The docs for
getBindingAdapterPosition
says:Nevertheless, since it's a possibility that
viewHolder.bindingAdapterPosition
returnsRecyclerView.NO_POSITION
which is equal to-1
, this PR adds handling for that by simply returning null when that happens. This makes the selection not happen on the item with no position, but it won't crash anymore.Steps to reproduce
Since I'm not sure how to test the issue, it's probably good to smoke test the bulk update order feature to ensure that it still works after this PR.
Testing information
n/a
The tests that have been performed
Smoke-tested the feature to ensure it still works with the changes in this PR.
Images/gif
RELEASE-NOTES.txt
if 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: