From 2397889a520ccaa79609ad89e0deaef1de1f4eb1 Mon Sep 17 00:00:00 2001 From: Dominic Ferrando Date: Fri, 17 Jul 2026 16:03:43 -0400 Subject: [PATCH] Remove SKU deletion --- packages/commerce/src/sync.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/packages/commerce/src/sync.ts b/packages/commerce/src/sync.ts index 0e0ec5b..91660ab 100644 --- a/packages/commerce/src/sync.ts +++ b/packages/commerce/src/sync.ts @@ -145,27 +145,6 @@ export class ProductSyncer { ); } } - - // Remove webflow SKUs whose color+size no longer corresponds to any current printful variant. - const currentPKeys = new Set( - pMetaProduct.entries.flatMap(({ colorGroup, product: pProduct }) => - pProduct.sync_variants.map((pVariant) => `${colorGroup ?? pVariant.color}::${pVariant.size}`) - ) - ); - const orphanedWSkus = wProduct.skus.filter((existingWSku) => - !currentPKeys.has(`${existingWSku.fieldData["sku-values"]?.["color"]}::${existingWSku.fieldData["sku-values"]?.["size"]}`) - ); - for (const orphanedWSku of orphanedWSkus) { - this.log.info( - { - wSkuId: orphanedWSku.id, - color: orphanedWSku.fieldData["sku-values"]?.["color"], - size: orphanedWSku.fieldData["sku-values"]?.["size"], - }, - "removing webflow SKU no longer present in printful", - ); - await this.Webflow.Products.Skus.remove(orphanedWSku.id); - } } else { this.log.info("existing webflow product not found, creating it");