[object Object]

← back to Dw Activation Calendar

chore: lint, refactor, version bump (session close)

58374716e5af7e0712a0e6358dd127a5e2f9b076 · 2026-07-22 12:27:17 -0700 · Steve Abrams

Files touched

Diff

commit 58374716e5af7e0712a0e6358dd127a5e2f9b076
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 22 12:27:17 2026 -0700

    chore: lint, refactor, version bump (session close)
---
 package.json            | 2 +-
 scripts/prune-active.js | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index d0f2deb..cddead8 100644
--- a/package.json
+++ b/package.json
@@ -1 +1 @@
-{"name":"dw-activation-calendar","version":"1.0.3","private":true,"scripts":{"start":"node server.js"}}
\ No newline at end of file
+{"name":"dw-activation-calendar","version":"1.0.4","private":true,"scripts":{"start":"node server.js"}}
\ No newline at end of file
diff --git a/scripts/prune-active.js b/scripts/prune-active.js
index faccc83..ff0a956 100644
--- a/scripts/prune-active.js
+++ b/scripts/prune-active.js
@@ -102,12 +102,16 @@ async function main() {
   const flipped = justActivatedIds();
 
   // Keep only ids that are still DRAFT in the mirror AND weren't just activated.
+  // Track zero-lag catches (still DRAFT in mirror but already in the activator audit)
+  // in a single pass instead of re-scanning skus twice.
+  let lagCaught = 0;
   const kept = skus.filter(s => {
     const id = String(s.shopify_id);
-    return draft.has(id) && !flipped.has(id);
+    if (!draft.has(id)) return false;
+    if (flipped.has(id)) { lagCaught++; return false; }
+    return true;
   });
   const removed = skus.length - kept.length;
-  const lagCaught = skus.filter(s => draft.has(String(s.shopify_id)) && flipped.has(String(s.shopify_id))).length;
   if (lagCaught) console.log(`prune-active: ${lagCaught} of those caught via activator audit before the mirror re-synced (zero-lag).`);
 
   if (removed === 0) { console.log(`prune-active: clean — all ${skus.length} scheduled items are still DRAFT.`); return; }

← 1d223be auto-save: 2026-07-22T11:43:42 (1 files) — data/activation-s  ·  back to Dw Activation Calendar  ·  auto-save: 2026-07-22T12:44:11 (1 files) — data/activation-s 4077412 →