Skip to content

Commit

Permalink
Jetpack Sync - HPOS module: Add missing handlers for removing or tras…
Browse files Browse the repository at this point in the history
…hing subscriptions (#40047)

* Jetpack Sync: Add hooks for removed and trashed Shop Subscriptions

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11684539218

Upstream-Ref: Automattic/jetpack@bb42d75
  • Loading branch information
fgiannar authored and matticbot committed Nov 5, 2024
1 parent 6ad1325 commit 9e93b13
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 125 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"automattic/jetpack-search": "^0.45.13-alpha",
"automattic/jetpack-stats": "^0.13.5",
"automattic/jetpack-status": "^4.0.3",
"automattic/jetpack-sync": "^3.14.4"
"automattic/jetpack-sync": "^3.14.5-alpha"
},
"require-dev": {
"automattic/jetpack-changelogger": "^4.2.8",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"automattic/jetpack-constants": "^2.0.5",
"automattic/jetpack-plans": "^0.4.13",
"automattic/jetpack-status": "^4.0.3",
"automattic/jetpack-sync": "^3.14.4",
"automattic/jetpack-sync": "^3.14.5-alpha",
"automattic/jetpack-protect-status": "^0.2.2"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.0",
"automattic/jetpack-connection": "^5.1.6",
"automattic/jetpack-plugins-installer": "^0.4.4",
"automattic/jetpack-sync": "^3.14.4",
"automattic/jetpack-sync": "^3.14.5-alpha",
"automattic/jetpack-protect-models": "^0.3.1",
"automattic/jetpack-plans": "^0.4.13"
},
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-search/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"automattic/jetpack-status": "^4.0.3",
"automattic/jetpack-config": "^2.0.4",
"automattic/jetpack-my-jetpack": "^4.37.0-alpha",
"automattic/jetpack-sync": "^3.14.4"
"automattic/jetpack-sync": "^3.14.5-alpha"
},
"require-dev": {
"automattic/jetpack-changelogger": "^4.2.8",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.14.5-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Fixed
- Jetpack Sync: Add missing handlers for removing or trashing shop_subscription orders

## [3.14.4] - 2024-11-04
### Added
- Enable test coverage. [#39961]
Expand Down Expand Up @@ -1326,6 +1333,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Move sync to a classmapped package

[3.14.5-alpha]: https://github.com/Automattic/jetpack-sync/compare/v3.14.4...v3.14.5-alpha
[3.14.4]: https://github.com/Automattic/jetpack-sync/compare/v3.14.3...v3.14.4
[3.14.3]: https://github.com/Automattic/jetpack-sync/compare/v3.14.2...v3.14.3
[3.14.2]: https://github.com/Automattic/jetpack-sync/compare/v3.14.1...v3.14.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '3.14.4';
const PACKAGE_VERSION = '3.14.5-alpha';

const PACKAGE_SLUG = 'sync';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ public function init_listeners( $callable ) {
add_filter( "jetpack_sync_before_enqueue_woocommerce_after_{$type}_object_save", array( $this, 'expand_order_object' ) );
}
add_action( 'woocommerce_delete_order', $callable );
add_action( 'woocommerce_delete_subscription', $callable );
add_filter( 'jetpack_sync_before_enqueue_woocommerce_delete_order', array( $this, 'on_before_enqueue_order_trash_delete' ) );
add_filter( 'jetpack_sync_before_enqueue_woocommerce_delete_subscription', array( $this, 'on_before_enqueue_order_trash_delete' ) );
add_action( 'woocommerce_trash_order', $callable );
add_action( 'woocommerce_trash_subscription', $callable );
add_filter( 'jetpack_sync_before_enqueue_woocommerce_trash_order', array( $this, 'on_before_enqueue_order_trash_delete' ) );
add_filter( 'jetpack_sync_before_enqueue_woocommerce_trash_subscription', array( $this, 'on_before_enqueue_order_trash_delete' ) );
}

/**
Expand Down Expand Up @@ -425,6 +429,12 @@ private static function wc_get_order_status_keys() {
);
}

if ( function_exists( 'wcs_get_subscription_statuses' ) ) {
// @phan-suppress-next-line PhanUndeclaredFunction -- Checked above. See also https://github.com/phan/phan/issues/1204.
$wc_subscription_statuses = array_keys( wcs_get_subscription_statuses() );
$wc_order_statuses = array_merge( $wc_order_statuses, $wc_subscription_statuses );
}

return array_unique( $wc_order_statuses );
}

Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
),
'jetpack-sync' => array(
'path' => 'jetpack_vendor/automattic/jetpack-sync',
'ver' => '3.14.4',
'ver' => '3.14.5-alpha1730811047',
),
),
);
66 changes: 33 additions & 33 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "175a128da6317c8b3e10f575aa606e463ea6a38f"
"reference": "753bd50a9e7fc136e88b6afdb2facc33973e6878"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -63,7 +63,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "70b1b5a08c9d556b71b9a97f2c22fe095046d481"
"reference": "23f1686a076e858e94ac07381bbe939a3f9075ce"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -131,7 +131,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "72fdc63c91067c30a922aa2fc2d12048aba17b2c"
"reference": "5a140f8fe237a8b2c128e87d210c724a7a68b168"
},
"require": {
"automattic/jetpack-constants": "^2.0.5",
Expand Down Expand Up @@ -204,7 +204,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "0ef6abc713a840b20a3bf59bf841eb6f2a066fa6"
"reference": "b7d2f8649b8eb9361eead71511757330a0358311"
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0",
Expand Down Expand Up @@ -275,7 +275,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-core",
"reference": "0f0a3bf0768711890354d9360efe0501809fa48e"
"reference": "5c1201ff21963095e94313bb51bff1e2069a611b"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down Expand Up @@ -346,7 +346,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
"reference": "964c8ca26fac3a3efb392ca8b9acb2e336865daa"
"reference": "0a4da6df5861919aa0380d62f5b619e968fc0457"
},
"require": {
"automattic/jetpack-boost-core": "^0.2.14",
Expand Down Expand Up @@ -425,7 +425,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "b5bbf57f2e8f2fe48ad4a3e2663767428602d443"
"reference": "0a1a9bef423609c822ddba80991a9f381ffa2c8e"
},
"require": {
"composer-plugin-api": "^2.1.0",
Expand Down Expand Up @@ -488,7 +488,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "2210cd84a13287b5cfcc23ec303b396101e2422c"
"reference": "9eff1f6c20128086b8f4b2245250c70b81b9edda"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -563,7 +563,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "0f7aaa70e6b5211fbe842830fb5989b9ad0dead5"
"reference": "15b03dd6d392a9ca0fbaf3617ebf40ebb6d9374c"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.4",
Expand Down Expand Up @@ -656,7 +656,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "cdabcf2f3c2d5ba6240c9cd39f93c24de88fda27"
"reference": "9748e135294498c28979e1b35877301074963626"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -713,7 +713,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "24f4b60101b3a6aaff9543cc39d033deb88e8528"
"reference": "7206f45cd62642b0afb951e756d8ef3c2a880a38"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -769,7 +769,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
"reference": "b5bf663389e12f2efa47c41df7a44d232cb572e9"
"reference": "ba961b270a0cb0c30a328fbafad3bb0f15d19e36"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down Expand Up @@ -848,7 +848,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "d6c4f5ac1a32f4988843b7758573da799877a1fb"
"reference": "0b4b94448171ae60d0c07315e05dd35ca71e5440"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -909,7 +909,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "ff3dfeccb9d189dbf78bfe87d6ab1467bbb12810"
"reference": "fd891fb3a7dd6de2bcf1b06643b48d8801e49cde"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.4",
Expand Down Expand Up @@ -987,7 +987,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "9b219094c747dac646321d3d055669053d4fb321"
"reference": "075592fc1cc8e1cd1cf5a204ef2ef7de2e844846"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down Expand Up @@ -1052,7 +1052,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "73b9e5f4040f8fbedbf1e00069e7788ecda3021d"
"reference": "5712c1f932811fbfa6c4cc9ccb0c31855fd7ae0a"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1108,7 +1108,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "64097a621c1bbb59ece5cdb97a137a4d5791124e"
"reference": "a07a0b55b9448f25122a1609147d3bc582c128c0"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.6",
Expand All @@ -1124,7 +1124,7 @@
"automattic/jetpack-protect-status": "^0.2.2",
"automattic/jetpack-redirect": "^2.0.5",
"automattic/jetpack-status": "^4.0.3",
"automattic/jetpack-sync": "^3.14.4",
"automattic/jetpack-sync": "^3.14.5-alpha",
"php": ">=7.0"
},
"require-dev": {
Expand Down Expand Up @@ -1214,7 +1214,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "1a1d3cd72f23741a89f2e5f4def55618e7cda4c0"
"reference": "45449a870620dad300dc6ed7d0abcd0f2ea5177e"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1278,7 +1278,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
"reference": "80301856f671d6feeb402ce422a4e50f8762138b"
"reference": "52a0db8cbe6e8b3ab159aff8f872e58bd3930bb6"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down Expand Up @@ -1349,7 +1349,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "8cd118f41997bfc389636885d6064b21012aa1f5"
"reference": "eea40b9f8fa099f8cf322e5b3009cd79c3eeec5e"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.4",
Expand Down Expand Up @@ -1408,7 +1408,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
"reference": "7db58669fc88ab9fcf36361aa446caae365f2dce"
"reference": "36268ee43f597b22e1a7b887c63261eb303086f5"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1481,14 +1481,14 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
"reference": "5c0ab0c99fc9463e5d7c93016feeeabb13e0285c"
"reference": "eade98ea059f4305d70365b92acedf57c5e4356c"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
"automattic/jetpack-plans": "^0.4.13",
"automattic/jetpack-plugins-installer": "^0.4.4",
"automattic/jetpack-protect-models": "^0.3.1",
"automattic/jetpack-sync": "^3.14.4",
"automattic/jetpack-sync": "^3.14.5-alpha",
"php": ">=7.0"
},
"require-dev": {
Expand Down Expand Up @@ -1559,7 +1559,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "d7106d5661c12ca64bf8e9ef253f1e2ed7aeca8b"
"reference": "53e389638628e0a4e6ff79dfe4706547e145c462"
},
"require": {
"automattic/jetpack-status": "^4.0.3",
Expand Down Expand Up @@ -1617,7 +1617,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "0107fe89c5655255559db9a910c8947ef6cc3e80"
"reference": "5a25d5017b1a670c990702c244a37948d3bd8c51"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1674,7 +1674,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-search",
"reference": "f5cb0bc509b59e4df6ce3666cca20b111d706d1d"
"reference": "854f3e7701dd08b70cb000fd9f81718ae2461e81"
},
"require": {
"automattic/jetpack-assets": "^2.3.13",
Expand All @@ -1683,7 +1683,7 @@
"automattic/jetpack-constants": "^2.0.5",
"automattic/jetpack-my-jetpack": "^4.37.0-alpha",
"automattic/jetpack-status": "^4.0.3",
"automattic/jetpack-sync": "^3.14.4",
"automattic/jetpack-sync": "^3.14.5-alpha",
"php": ">=7.0"
},
"require-dev": {
Expand Down Expand Up @@ -1766,7 +1766,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
"reference": "e9eeb0e14d8de8e048d37c89807a427126b24e48"
"reference": "75c04394a8b33539abe30ba22daa7a8c7e339851"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down Expand Up @@ -1836,7 +1836,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "008f6b98f0ec7ec2931db91453e5c35c59b436d1"
"reference": "ec363adf24168f65a459fc00488b6039b3c52d32"
},
"require": {
"automattic/jetpack-constants": "^2.0.5",
Expand Down Expand Up @@ -1898,12 +1898,12 @@
},
{
"name": "automattic/jetpack-sync",
"version": "3.14.4",
"version_normalized": "3.14.4.0",
"version": "3.14.5-alpha.1730811047",
"version_normalized": "3.14.5.0-alpha1730811047",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "f5b5df3ce9c9ec95ed994ac85cffdfb628447340"
"reference": "3605324ab1b3a97461e36e291460192facbe6247"
},
"require": {
"automattic/jetpack-connection": "^5.1.6",
Expand Down
Loading

0 comments on commit 9e93b13

Please sign in to comment.