← back to Designer Wallcoverings
Fix fail-loud false-positive: page-1-empty guard only fires in FULL mode (quick mode 0-new is valid)
a798cd48b1d05988d676f55a07164a1fc355ae19 · 2026-07-12 11:56:15 -0700 · Steve
Files touched
M shopify/scripts/sync-shopify-products.js
Diff
commit a798cd48b1d05988d676f55a07164a1fc355ae19
Author: Steve <steve@designerwallcoverings.com>
Date: Sun Jul 12 11:56:15 2026 -0700
Fix fail-loud false-positive: page-1-empty guard only fires in FULL mode (quick mode 0-new is valid)
---
shopify/scripts/sync-shopify-products.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/shopify/scripts/sync-shopify-products.js b/shopify/scripts/sync-shopify-products.js
index bacf6ae9..2d42e073 100644
--- a/shopify/scripts/sync-shopify-products.js
+++ b/shopify/scripts/sync-shopify-products.js
@@ -142,9 +142,10 @@ async function syncProducts(quickMode = false) {
const products = result.data?.products?.edges || [];
const pageInfo = result.data?.products?.pageInfo;
- // FAIL-LOUD: page 1 returning zero products = auth/empty-store failure, not a real sync.
- if (page === 1 && products.length === 0) {
- console.error('❌ SYNC FAILED — page 1 returned 0 products (auth failure or empty store). Refusing to report success.');
+ // FAIL-LOUD: in FULL mode, page 1 returning zero products = auth/empty-store failure.
+ // In QUICK mode, zero products on page 1 is VALID ("nothing new since last sync") — don't alarm.
+ if (page === 1 && products.length === 0 && !quickMode) {
+ console.error('❌ SYNC FAILED — full-sync page 1 returned 0 products (auth failure or empty store). Refusing to report success.');
await pool.end();
process.exit(1);
}
← 977a5291 Harden mirror sync: dotenv self-load (no more token-less sil
·
back to Designer Wallcoverings
·
auto-save: 2026-07-12T12:48:16 (4 files) — pending-approval/ fe814194 →