Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Jun 25, 2025

Closes WOOMOB-682

Description

This PR fixes the incorrect package dimensions when height is unavailable.

Previously we were using the last dimension as the height. This is incorrect when the API response for packages doesn't include a height for a package.

The solution is to access dimensions by safe indices and return nil if unavailable.

Another problem is when sending a 0 height, the label rates request would fail with an unexpected value error. This PR adds a workaround to set a default value of 0.25 in this case, the rates returned would still be the same for predefined packages [p1750923325060079-slack-C05VBLKHHV1].

Testing steps

  1. Log in to a store with Woo Shipping extension set up.
  2. Navigate to the Orders tab and select a paid order with physical products.
  3. Select Create shipping label and tap Add a package.
  4. Switch to the Carrier tab > UPS and confirm that the UPS letter package doesn't display a height.
  5. Select UPS letter package and confirm that the corresponding rates are loaded successfully.
  6. Proceed to purchase the label and confirm that purchase completes successfully.

Testing information

Tested and confirmed with simulator iPhone 16 iOS 18.4.

Screenshots

Simulator.Screen.Recording.-.iPhone.16.-.2025-06-26.at.15.09.04.mp4

  • 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.6 ❄️ milestone Jun 25, 2025
@itsmeichigo itsmeichigo added feature: shipping labels Related to creating, ordering, or printing shipping labels. Bug labels Jun 25, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jun 25, 2025

1 Warning
⚠️ This PR is assigned to the milestone 22.6 ❄️. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 25, 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 Number30755
VersionPR #15812
Bundle IDcom.automattic.alpha.woocommerce
Commitad88973
Installation URL0ao7hahp2lego
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review June 26, 2025 08:27
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.

@itsmeichigo itsmeichigo merged commit 8f0de03 into release/22.6 Jun 26, 2025
17 checks passed
@itsmeichigo itsmeichigo deleted the woomob-682-shipping-label-in-correct-height-for-predefined-packages branch June 26, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants