woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

Core Data: Replace unnecessary fetch requests for upserting orders and order search results

Open itsmeichigo opened this issue 1 year ago • 3 comments

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.txt if 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.

itsmeichigo avatar Oct 15 '24 09:10 itsmeichigo

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14128-b2893df
Version20.8
Bundle IDcom.automattic.alpha.woocommerce
Commitb2893dfcc4d22d6bfec1bc8bf1ecfb59118b692d
App Center BuildWooCommerce - Prototype Builds #11234
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar Oct 15 '24 09:10 wpmobilebot

Thanks @selanthiraiyan for the reviews! I addressed your comment with a commit above, this PR is ready for another look.

itsmeichigo avatar Oct 18 '24 02:10 itsmeichigo

Version 20.8 has now entered code-freeze, so the milestone of this PR has been updated to 20.9.

wpmobilebot avatar Oct 18 '24 09:10 wpmobilebot

@selanthiraiyan I responded to your questions, please let me know if anything is still unclear. Thanks!

itsmeichigo avatar Oct 22 '24 07:10 itsmeichigo