Skip to content

Conversation

@joshheald
Copy link
Contributor

@joshheald joshheald commented Dec 3, 2025

Description

This PR updates our handling of missing variations at POS checkout to work correctly with DotcomError as it already did with NetworkError.

DotcomError is returned when your requests are going through the WPCom tunnel, which was recently updated to return the data object in these errors.

This PR updates our DotcomError enum to make that data available, similar to how it is with NetworkError, and use it in the same way in the POSOrderService when checking out.

The PR's a bit big because I opted to make the error data available everywhere, so we can use it better in future.

Test Steps

  1. Using WPCom credentials, log in to a site with the variation IDs returned in checkout errors (e.g. woocommerce-tester.mystagingwebsite.com – there's a core change on there which isn't in core yet. Alternatively, use a jurassic ninja site with this PR deployed: Include variation_id in order item invalid variation error data woocommerce#62240)
  2. Add a variation to your POS cart
  3. In WP-Admin, delete that variation
  4. Check out
  5. Observe that the variation's name is shown in the error, and it can be removed using a button at check out (no need to go back and edit the order)

Screenshots

variation.errors.with.dotcom.error.mp4

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

- Add `data` to `DotcomError.unknown` case
- Parse `data` and handle variation ID when present during POS checkout
- Update other uses of it to use the new signature
@joshheald joshheald added this to the 23.9 milestone Dec 3, 2025
@joshheald joshheald added type: task An internally driven task. feature: POS labels Dec 3, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 3, 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 Numberpr16430-96d9ab1
Version23.8
Bundle IDcom.automattic.alpha.woocommerce
Commit96d9ab1
Installation URL00l1lpbv91s6g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iamgabrielma iamgabrielma self-assigned this Dec 4, 2025
@iamgabrielma
Copy link
Contributor

I'm having troubles logging into a jurassic ninja site with the PR loaded ( logged at WOOMOB-1850 ), would you mind to invite me to one of your sites where this PR is active?

@joshheald
Copy link
Contributor Author

joshheald commented Dec 4, 2025

@iamgabrielma You already have an account on https://woocommerce-tester.mystagingwebsite.com/ which has the fix 👍

Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

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

Works well! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants