Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Jul 7, 2025

Closes WOOMOB-771

Description

Currently we're syncing countries for every order item in the customs form and in the address form as well. The country list is unlikely to change so often, so making these requests so frequently is unnecessary.

Since both customs form and edit address form are getting the country list from storage, syncing the list with the remote once when starting the purchase flow should be sufficient.

This PR optimizes the requests by moving the syncing request to the purchase form and remove the requests from the other forms.

Testing steps

  1. Remove the Woo app from your simulator/device if it's already installed to clear all cached data.
  2. Install the app and log in to a test store with Woo Shipping set up.
  3. Navigate to the Orders tab and select an order eligible for creating shipping labels with multiple items.
  4. Update the shipping address to an address outside of the US.
  5. Open the purchase flow and confirm with Proxyman that the country list is fetched only once.
  6. Open a customs form and confirm that the country list is correct.
  7. Open the edit address form for the origin or destination address.
  8. Confirm with Proxyman that the country list is not fetched again. Confirm that the country list is correct.

Testing information

Tested with simulator iPhone 16 iOS 18.4.

Screenshots

No UI changes.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 22.8 milestone Jul 7, 2025
@itsmeichigo itsmeichigo added feature: shipping labels Related to creating, ordering, or printing shipping labels. Enhancement labels Jul 7, 2025
@itsmeichigo itsmeichigo marked this pull request as ready for review July 7, 2025 08:29
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 7, 2025

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

App NameWooCommerce iOS Prototype
Build Numberpr15875-3fdaad5
Version22.7
Bundle IDcom.automattic.alpha.woocommerce
Commit3fdaad5
Installation URL39upoof2hrs5g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo requested a review from RafaelKayumov July 7, 2025 08:36
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Works as described. The countries list looks complete in the app. The countries list /wc/v3/data/countries&_method=get fetched only once according to Proxyman.

@itsmeichigo itsmeichigo enabled auto-merge July 9, 2025 02:22
@itsmeichigo itsmeichigo merged commit 5b02539 into trunk Jul 9, 2025
13 checks passed
@itsmeichigo itsmeichigo deleted the woomob-771-shipping-label-optimize-country-fetches branch July 9, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement feature: shipping labels Related to creating, ordering, or printing shipping labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants