Skip to content

Sync WooCommerce module: Start syncing 'woocommerce_customer_object_updated_props' actions#49551

Open
fgiannar wants to merge 2 commits into
trunkfrom
add/sync-woo-customer-props-updated
Open

Sync WooCommerce module: Start syncing 'woocommerce_customer_object_updated_props' actions#49551
fgiannar wants to merge 2 commits into
trunkfrom
add/sync-woo-customer-props-updated

Conversation

@fgiannar

@fgiannar fgiannar commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Related to ACTLOG-52

Proposed changes

  • Add WooCommerce customer account detail update events to Sync by listening to woocommerce_customer_object_updated_props.
  • Replace the raw WC_Customer action argument before enqueueing with a minimal WP_User-shaped object containing only ID, display name, login, and email.
  • Send sanitized changed prop names as the second action argument.
  • Add Sync test coverage verifying the emitted action payload shape and confirming updated billing values are not serialized.

Related product discussion/links

See ACTLOG-53.

Does this pull request change what data or activity we track or use?

Yes. This starts syncing WooCommerce customer account detail update activity through the existing Jetpack Sync event pipeline.

The synced payload includes:

  • A minimal user object: external user ID, display name, login, and email.
  • Sanitized changed prop names, such as billing_email or shipping_city.

The synced payload does not include:

  • Billing or shipping address values.
  • Billing phone values.
  • The full WC_Customer object.

Testing instructions

Automated

From a Jetpack checkout with the Docker test environment installed:

JETPACK_TEST_WOOCOMMERCE=1 jp docker phpunit jetpack -- --filter=Jetpack_Sync_WooCommerce_Test::test_customer_updated_props_are_synced_without_customer_data

Expected: the test passes and verifies that the Sync event stores:

  • A minimal user object as arg 0.
  • Changed prop names as arg 1.
  • No raw updated billing values.

Manual

You'll need to apply the WPCOM counterpart PR to your sandbox: 222803-ghe-Automattic/wpcom

  1. Use a connected Jetpack site with WooCommerce active.
  2. Create or use a WooCommerce customer associated with a WordPress user.
  3. Update customer account/contact details, for example billing email and shipping city, from wp-admin or the customer's My Account page.
  4. Trigger or wait for Sync processing.
  5. Inspect the synced woocommerce_customer_object_updated_props action.
  6. Confirm arg 0 is a minimal user object, not a full WC_Customer.
  7. Confirm arg 1 contains changed prop names, such as billing_email and shipping_city.
  8. Confirm the payload does not include the raw updated billing or shipping values.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/sync-woo-customer-props-updated branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/sync-woo-customer-props-updated
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/sync-woo-customer-props-updated

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests labels Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 7, 2026
    • Code freeze: July 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@fgiannar fgiannar added the [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account label Jun 11, 2026
@jp-launch-control

jp-launch-control Bot commented Jun 11, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/sync/src/modules/class-woocommerce.php 0/155 (0.00%) 0.00% 39 💔

Full summary · PHP report · JS report

Coverage check overridden by Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code .

@fgiannar fgiannar added the Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code [Package] Sync [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant