woocommerce-ios
woocommerce-ios copied to clipboard
Core Data: Replace unnecessary fetch requests for upserting orders and order search results
Part of #14090
Description
This PR follows the suggestion in p91TBi-cl2-p2 to clean up unnecessary and expensive fetch requests made in for loops for orders including:
- Order search results
- Order items and item taxes
- Order coupons
- Order fees
- Order shipping lines & shipping line taxes
- Order taxes
Steps to reproduce
- Log in to a test store with existing products.
- Create an order by selecting one or more products, and adding coupons, fees, shipping, and taxes. Save the changes.
- Open the new order from the order list and confirm that all details are correct.
- Tap the Search button and search for any order. Confirm that the feature works as expected.
Testing information
Tested with simulator iPhone 15 Pro iOS 17.4 and confirmed that order deails and order search work correctly. All unit tests still pass.
Screenshots
N/A
- [ ] I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txtif necessary.
TODO: @itsmeichigo to update the release notes before merging.
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:
- [ ] The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
- [ ] Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
- [ ] Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
| App Name | ||
| Build Number | pr14128-b2893df | |
| Version | 20.8 | |
| Bundle ID | com.automattic.alpha.woocommerce | |
| Commit | b2893dfcc4d22d6bfec1bc8bf1ecfb59118b692d | |
| App Center Build | WooCommerce - Prototype Builds #11234 |
Thanks @selanthiraiyan for the reviews! I addressed your comment with a commit above, this PR is ready for another look.
Version 20.8 has now entered code-freeze, so the milestone of this PR has been updated to 20.9.
@selanthiraiyan I responded to your questions, please let me know if anything is still unclear. Thanks!