← back to CelebritySignatures
wear: fix recolored signature URL being relative, not absolute (TK-10286)
c9d72f3118ab8f649ed8a185e79d17585fd0a874 · 2026-09-09 07:41:40 -0700 · Steve Abrams
Real bug caught via a2a by codex-run-10286 (also actively on this ticket) —
recolorSignatureToLight() returned a RELATIVE path
(/assets/recolored-signatures/<hash>.png), set directly as
draft.design_image_url. That flows straight into
submit-pod-draft-printify.mjs's buildPayload() as images[0].src, which
Printify fetches from the public internet — a relative path would have
failed there (or worse, resolved against whatever base the fetcher assumes).
Both the cache-hit AND cache-miss return paths had the bug.
Fixed in both places that build this URL (server.js, and the duplicate in
reconcile-wear-orders.mjs — same reasoning already applied to
extraPrintAreas' imageUrl in submit-pod-draft-printify.mjs, which already
prefixes with the site origin): added WEAR_SITE_ORIGIN and prefixed both
return points. Verified the function now returns a proper
https://celebsignatures.com/... URL.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmxcNKtFg77wP47uZq5Zsm
Files touched
M scripts/reconcile-wear-orders.mjsM server.js
Diff
commit c9d72f3118ab8f649ed8a185e79d17585fd0a874
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Sep 9 07:41:40 2026 -0700
wear: fix recolored signature URL being relative, not absolute (TK-10286)
Real bug caught via a2a by codex-run-10286 (also actively on this ticket) —
recolorSignatureToLight() returned a RELATIVE path
(/assets/recolored-signatures/<hash>.png), set directly as
draft.design_image_url. That flows straight into
submit-pod-draft-printify.mjs's buildPayload() as images[0].src, which
Printify fetches from the public internet — a relative path would have
failed there (or worse, resolved against whatever base the fetcher assumes).
Both the cache-hit AND cache-miss return paths had the bug.
Fixed in both places that build this URL (server.js, and the duplicate in
reconcile-wear-orders.mjs — same reasoning already applied to
extraPrintAreas' imageUrl in submit-pod-draft-printify.mjs, which already
prefixes with the site origin): added WEAR_SITE_ORIGIN and prefixed both
return points. Verified the function now returns a proper
https://celebsignatures.com/... URL.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmxcNKtFg77wP47uZq5Zsm
---
scripts/reconcile-wear-orders.mjs | 6 +++++-
server.js | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/scripts/reconcile-wear-orders.mjs b/scripts/reconcile-wear-orders.mjs
index 4ad7b4c..fb605ad 100644
--- a/scripts/reconcile-wear-orders.mjs
+++ b/scripts/reconcile-wear-orders.mjs
@@ -80,11 +80,15 @@ const wearLuminance = hex => {
return (0.299*r + 0.587*g + 0.114*b) / 255;
};
const RECOLOR_DIR = join(ROOT, 'public', 'assets', 'recolored-signatures');
+const WEAR_SITE_ORIGIN = 'https://celebsignatures.com';
async function recolorSignatureToLight(imageUrl) {
try {
const hash = createHash('sha256').update(imageUrl).digest('hex').slice(0, 24);
const outPath = join(RECOLOR_DIR, `${hash}.png`);
- const outUrl = `/assets/recolored-signatures/${hash}.png`;
+ // FULLY QUALIFIED — flows into the Printify order payload as images[0].src,
+ // which Printify fetches from the public internet (caught via a2a from
+ // codex-run-10286, 2026-09-09).
+ const outUrl = `${WEAR_SITE_ORIGIN}/assets/recolored-signatures/${hash}.png`;
try { await readFile(outPath); return outUrl; } catch {}
const src = await fetch(imageUrl);
if (!src.ok) throw new Error(`fetch ${src.status}`);
diff --git a/server.js b/server.js
index c9d9bfa..877cf81 100644
--- a/server.js
+++ b/server.js
@@ -239,6 +239,7 @@ const wearLuminance = hex => {
return (0.299*r + 0.587*g + 0.114*b) / 255;
};
const RECOLOR_DIR = join(ROOT, 'public', 'assets', 'recolored-signatures');
+const WEAR_SITE_ORIGIN = 'https://celebsignatures.com';
// Real print fix for the KNOWN ISSUE noted in wear-templates.json: Printify
// prints a design's own pixel colors as-is (no auto-recolor for dark
// garments), so a dark-ink signature on a dark colorway (e.g. the polo's
@@ -254,7 +255,11 @@ async function recolorSignatureToLight(imageUrl) {
try {
const hash = createHash('sha256').update(imageUrl).digest('hex').slice(0, 24);
const outPath = join(RECOLOR_DIR, `${hash}.png`);
- const outUrl = `/assets/recolored-signatures/${hash}.png`;
+ // FULLY QUALIFIED — this URL gets set as design_image_url on the draft,
+ // which flows straight into the Printify order payload as images[0].src;
+ // Printify fetches it from the public internet, so a relative path would
+ // fail there (caught via a2a from codex-run-10286, 2026-09-09).
+ const outUrl = `${WEAR_SITE_ORIGIN}/assets/recolored-signatures/${hash}.png`;
try { await readFile(outPath); return outUrl; } catch {} // cache hit
const src = await fetch(imageUrl);
if (!src.ok) throw new Error(`fetch ${src.status}`);
← c2a79ec wear: independent Stripe live switch — allows one test order
·
back to CelebritySignatures
·
Verify recolored wear artwork through both fulfillment draft c90a83c →