[object Object]

← back to Designer Wallcoverings

Wire mirrorWriteThrough into houston-mfr-fix + pr-quote-only-tag: future runs self-reconcile the mirror (retrofit, session close)

fa9fa2f26334e7a0943df62b7f313b62785ac7a3 · 2026-07-13 00:00:59 -0700 · Steve

Files touched

Diff

commit fa9fa2f26334e7a0943df62b7f313b62785ac7a3
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 13 00:00:59 2026 -0700

    Wire mirrorWriteThrough into houston-mfr-fix + pr-quote-only-tag: future runs self-reconcile the mirror (retrofit, session close)
---
 scripts/houston-mfr-fix.js   | 2 ++
 scripts/pr-quote-only-tag.js | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/scripts/houston-mfr-fix.js b/scripts/houston-mfr-fix.js
index 87e68ba9..a5bbc753 100644
--- a/scripts/houston-mfr-fix.js
+++ b/scripts/houston-mfr-fix.js
@@ -140,6 +140,8 @@ async function main() {
         if (ue.length) { lastErr = JSON.stringify(ue); break; }              // real userError → don't retry
         if (!j.data.metafieldsSet.metafields?.length) { lastErr = 'no-metafields-returned'; await sleep(1500*attempt); continue; }
         wrote = true;
+        // write-through: keep the local mirror's mfr_sku in step with this Shopify write (best-effort)
+        await mirrorWriteThrough(pool, gid, { mfr_sku: m.new }).catch(() => {});
         const avail = j.extensions?.cost?.throttleStatus?.currentlyAvailable ?? 1000; // adaptive pacing off the real bucket
         await sleep(avail < 300 ? 800 : 220);
       } catch (e) { lastErr = e.message; await sleep(1500 * attempt); }
diff --git a/scripts/pr-quote-only-tag.js b/scripts/pr-quote-only-tag.js
index 3b2285e3..0d1d4b57 100644
--- a/scripts/pr-quote-only-tag.js
+++ b/scripts/pr-quote-only-tag.js
@@ -15,6 +15,7 @@ const { Pool } = require('pg');
 const fs = require('fs');
 const path = require('path');
 require('dotenv').config({ path: path.join(__dirname, '..', '.env') });
+const { mirrorWriteThrough } = require('../shopify/scripts/lib/mirror-write-through');
 
 const EXECUTE = process.argv.includes('--execute');
 const pool = new Pool({ connectionString: process.env.DATABASE_URL || 'postgresql://dw_admin@127.0.0.1:5432/dw_unified' });
@@ -64,6 +65,8 @@ async function main() {
         if (ue.length) { lastErr = JSON.stringify(ue); break; }                      // real userError → don't retry
         if (!j.data.productUpdate.product?.id) { lastErr = 'no-product-returned'; await sleep(1500*attempt); continue; }
         wrote = true;
+        // write-through: reflect the new tags in the local mirror immediately (best-effort)
+        await mirrorWriteThrough(pool, gid, { tags: tags.join(', ') }).catch(() => {});
         const avail = j.extensions?.cost?.throttleStatus?.currentlyAvailable ?? 1000;
         await sleep(avail < 300 ? 800 : 220);
       } catch (e) { lastErr = e.message; await sleep(1500 * attempt); }

← 7f72958e auto-save: 2026-07-12T23:21:12 (4 files) — pending-approval/  ·  back to Designer Wallcoverings  ·  brands-grid: stage ÉLITIS mark as elitis-wallcoverings.png ( f845ced4 →