[object Object]

← back to Dw Pairs Well

chore: lint, refactor (DRY sourceArchived + null-status guard), vpatch (session close)

2fc0641554917d97ef224721ebb99381da022692 · 2026-07-13 12:25:58 -0700 · Steve Abrams

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Files touched

Diff

commit 2fc0641554917d97ef224721ebb99381da022692
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jul 13 12:25:58 2026 -0700

    chore: lint, refactor (DRY sourceArchived + null-status guard), vpatch (session close)
    
    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---
 package-lock.json | 4 ++--
 package.json      | 2 +-
 server.js         | 3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index f12d88f..614cc6e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "dw-pairs-well",
-  "version": "0.1.1",
+  "version": "0.1.2",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "dw-pairs-well",
-      "version": "0.1.1",
+      "version": "0.1.2",
       "dependencies": {
         "dotenv": "^16.4.5",
         "express": "^4.19.2",
diff --git a/package.json b/package.json
index b0af6cb..60a4023 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dw-pairs-well",
-  "version": "0.1.1",
+  "version": "0.1.2",
   "description": "Returns 6 design-coordinating wallcoverings for any DW SKU — powers the Pairs Well With This Design button on Shopify product pages.",
   "main": "server.js",
   "scripts": {
diff --git a/server.js b/server.js
index 245c61f..3df25ec 100644
--- a/server.js
+++ b/server.js
@@ -1068,7 +1068,8 @@ app.get('/api/similar', async (req, res) => {
     if (!source) return res.status(404).json({ ok: false, error: 'source not found' });
 
     const requestedK = Math.max(1, Math.min(24, parseInt(req.query.limit, 10) || 12));
-    const sourceArchived = source.status !== 'ACTIVE';
+    // null status = unknown, treat as live (not archived) rather than false-flag it
+    const sourceArchived = source.status != null && source.status !== 'ACTIVE';
     // CLIP when explicitly requested (?engine=clip) OR when SIMILAR_CLIP_DEFAULT is on
     // and the caller didn't force ?engine=tag. Same one-switch pattern as pairs.
     const engine = (req.query.engine === 'clip' || (SIMILAR_CLIP_DEFAULT && req.query.engine !== 'tag'))

← 2fd335e auto-save: 2026-07-13T12:24:56 (1 files) — server.js  ·  back to Dw Pairs Well  ·  (newest)