← back to Wallco Ai
etsyEligible: graceful fallback when seam-defect-boxes.py isn't deployed — scripts/ is rsync-excluded on prod, so the Etsy toolbar button was hard-failing eligibility on every design. Now returns SKIPPED + ok=true; force:true still bypasses.
f55c3ff11d1e703a4362ad972bf1a65d21c961d9 · 2026-05-28 10:07:16 -0700 · Steve Abrams
Files touched
Diff
commit f55c3ff11d1e703a4362ad972bf1a65d21c961d9
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu May 28 10:07:16 2026 -0700
etsyEligible: graceful fallback when seam-defect-boxes.py isn't deployed — scripts/ is rsync-excluded on prod, so the Etsy toolbar button was hard-failing eligibility on every design. Now returns SKIPPED + ok=true; force:true still bypasses.
---
server.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/server.js b/server.js
index 783c03a..b6aa817 100644
--- a/server.js
+++ b/server.js
@@ -1194,9 +1194,16 @@ app.get(['/admin/seam-debug', '/admin/seam-debug/:id'], (req, res) => {
function etsyEligible(id) {
// Cheap pre-check: file present + seam scores acceptable. Runs the
// seam-defect-boxes scanner; verdict 'PASS' or 'WARN' is eligible, 'FAIL' is not.
+ // On prod the scripts/ dir is rsync-excluded (Mac2-only ops scripts), so the
+ // scanner won't be there — fall back to "ok, eligibility skipped" so the
+ // toolbar Etsy button works on prod. Use force:true to bypass entirely.
+ const scriptPath = path.join(__dirname, 'scripts', 'seam-defect-boxes.py');
+ if (!fs.existsSync(scriptPath)) {
+ return { ok: true, verdict: 'SKIPPED', reason: 'scanner not deployed on this host — eligibility not checked', skipped: true };
+ }
try {
const scanOut = _execFileSyncSeam('python3',
- [path.join(__dirname, 'scripts', 'seam-defect-boxes.py'), '--id', String(id)],
+ [scriptPath, '--id', String(id)],
{ encoding: 'utf8', timeout: 30000, maxBuffer: 4 * 1024 * 1024 });
const r = JSON.parse(scanOut);
if (!r.ok) return { ok: false, reason: r.error || 'scan failed' };
← a04f46c unpublish endpoint: read+write the catalog snapshot (in-memo
·
back to Wallco Ai
·
admin pages: q() now anchors '/'-prefixed paths to location. 77dbbab →