Skip to content

Commit d82a818

Browse files
committed
Modify comparison approach
1 parent 613006a commit d82a818

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/packages/sync/src/modules/class-woocommerce-hpos-orders.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,12 @@ public function on_before_enqueue_order_save( $args ) {
344344
$previous = get_transient( $cache_key );
345345

346346
// If no substantive changes, skip enqueue.
347-
if ( $previous === $checksum ) {
347+
if ( is_string( $previous ) && hash_equals( $previous, $checksum ) ) {
348348
return false;
349349
}
350350

351351
// Remember current signature briefly to avoid "Update" or "Recalculate" clicks syncing again with no changes.
352-
set_transient( $cache_key, (string) $checksum, 5 * MINUTE_IN_SECONDS );
352+
set_transient( $cache_key, $checksum, 5 * MINUTE_IN_SECONDS );
353353

354354
$processed[ $order_id ] = true;
355355

0 commit comments

Comments
 (0)