[object Object]

← back to Designerwallcoverings

TK-11635: restore rollback fidelity — recreate weight + tracked, not just sku

628279c9842c1704575e73f60d8627f1de72ac0f · 2026-09-13 16:23:40 -0700 · Steve Abrams

Census of all 462 placeholders found 462/462 carry a non-zero weight (2 lb) and tracked=true.
The rollback only set sku, so firing it would have recreated 462 ZERO-WEIGHT variants on ACTIVE
products — the exact condition dw-active-weight-canary FAILs on (TK-11414). A rollback must not
trip a fleet canary. Also restores tracked as-was rather than quietly 'improving' it to false,
so a rollback returns to the known prior state and stays attributable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXQjayvMLrRoUmj3pFfcAB

Files touched

Diff

commit 628279c9842c1704575e73f60d8627f1de72ac0f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Sep 13 16:23:40 2026 -0700

    TK-11635: restore rollback fidelity — recreate weight + tracked, not just sku
    
    Census of all 462 placeholders found 462/462 carry a non-zero weight (2 lb) and tracked=true.
    The rollback only set sku, so firing it would have recreated 462 ZERO-WEIGHT variants on ACTIVE
    products — the exact condition dw-active-weight-canary FAILs on (TK-11414). A rollback must not
    trip a fleet canary. Also restores tracked as-was rather than quietly 'improving' it to false,
    so a rollback returns to the known prior state and stays attributable.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01PXQjayvMLrRoUmj3pFfcAB
---
 scripts/tk11635-fentucci-zerovariant-restore.mjs | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/tk11635-fentucci-zerovariant-restore.mjs b/scripts/tk11635-fentucci-zerovariant-restore.mjs
index 59c390b..842dcbb 100644
--- a/scripts/tk11635-fentucci-zerovariant-restore.mjs
+++ b/scripts/tk11635-fentucci-zerovariant-restore.mjs
@@ -55,7 +55,18 @@ let ok = 0, err = 0;
 for (const r of need) {
   const opts = (r.selected_options || []).map(o => ({ optionName: o.name, name: o.value }));
   const v = { price: '0.00', inventoryPolicy: 'DENY', optionValues: opts.length ? opts : [{ optionName: 'Title', name: 'Per Yard' }] };
-  if (r.sku) v.inventoryItem = { sku: r.sku, tracked: false };
+  // Restore the FULL inventoryItem payload, not just the sku. Two reasons this is not optional:
+  //  - WEIGHT: all 462 placeholders carry a non-zero weight. Recreating them weightless would put 462
+  //    zero-weight variants on ACTIVE products, which is exactly what dw-active-weight-canary FAILS on
+  //    (TK-11414). A rollback must not trip a fleet canary.
+  //  - TRACKED: restore it as it was. A rollback's job is to return to the known prior state, not to
+  //    slip in an improvement — quietly restoring tracked=false would silently change behaviour and
+  //    make it impossible to attribute whatever happens next.
+  const inv = {};
+  if (r.sku) inv.sku = r.sku;
+  if (r.inventory_item_tracked !== null && r.inventory_item_tracked !== undefined) inv.tracked = r.inventory_item_tracked;
+  if (r.weight && Number(r.weight.value) > 0) inv.measurement = { weight: { value: Number(r.weight.value), unit: r.weight.unit } };
+  if (Object.keys(inv).length) v.inventoryItem = inv;
   const d = await gql(M, { productId: r.product_gid, variants: [v] });
   const ue = d?.productVariantsBulkCreate?.userErrors || [];
   if (d?.__err || ue.length) { err++; console.error(`  ERR ${r.handle}:`, JSON.stringify(d?.__err || ue)); continue; }

← bf894f2 TK-11076: three more undo defects, two surfaced by a second-  ·  back to Designerwallcoverings  ·  TK-11574: exhaustive phrasing-agnostic title_tag backstop (r 230e03d →