← back to Shopify Sample Shipping
install-theme-engine: abort (with undo hint) if the dev theme is still processing after 120s instead of uploading into it
48e922941c1c7a5a04b7b8bbde91b1bb309cbb44 · 2026-09-24 16:00:32 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrEDNvrmHyv2QgB23Lm151
Files touched
M install-theme-engine.mjs
Diff
commit 48e922941c1c7a5a04b7b8bbde91b1bb309cbb44
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Sep 24 16:00:32 2026 -0700
install-theme-engine: abort (with undo hint) if the dev theme is still processing after 120s instead of uploading into it
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrEDNvrmHyv2QgB23Lm151
---
install-theme-engine.mjs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/install-theme-engine.mjs b/install-theme-engine.mjs
index 52e0c29..34ec52c 100644
--- a/install-theme-engine.mjs
+++ b/install-theme-engine.mjs
@@ -70,7 +70,9 @@ if (String(dt.role).toUpperCase() === 'MAIN' || String(dt.role).toUpperCase() ==
fs.writeFileSync(REC, JSON.stringify({ at: new Date().toISOString(), devThemeGid: devGid, devThemeId: devId, devThemeName: dt.name, sourceThemeId: MAIN_THEME_ID, modifiedFiles: [SNIPPET_KEY, CART_FILE], published: false }, null, 2) + '\n');
// 2) wait for duplication to finish processing before uploading assets
-for (let i = 0; i < 40; i++) { const t = await restGetTheme(devId); if (!t.processing) break; await new Promise(r => setTimeout(r, 3000)); }
+let ready = false;
+for (let i = 0; i < 40; i++) { const t = await restGetTheme(devId); if (!t.processing) { ready = true; break; } await new Promise(r => setTimeout(r, 3000)); }
+if (!ready) { console.error('⛔ dev theme still processing after 120s — aborting before any upload. Undo: node theme-engine-undo.mjs --apply'); process.exit(1); }
// 3) upsert the snippet
const up = (await query(`mutation($t:ID!,$f:[OnlineStoreThemeFilesUpsertFileInput!]!){themeFilesUpsert(themeId:$t,files:$f){upsertedThemeFiles{filename} userErrors{filename code message}}}`,
← 8432862 install-theme-engine: read themeDuplicate.newTheme (payload
·
back to Shopify Sample Shipping
·
(newest)