@davoodmehraban89 / VELYQOR / commits / d686a93
Fork 0

Intelligence, Advanced Charting & Trading Platform

test(incident): retry intermittent public preview GET failures without changing live data

davoodmehraban89 committed Oct 15, 2026 at 19:38 UTC d686a93d9f71f2a73fb661861370929bfbeb7753
1 file changed +6 -3
scripts/diagnose-chartnova-v27-sw-cache.mjs
+6 -3
@@ -7,9 +7,12 @@
7 import {chromium} from 'playwright';
8 const host='https://2cbeb4e2-velyqor-preview.davoodmehraban89.workers.dev/';
9 const check=async path=>{
10 - const r=await fetch(host+path,{signal:AbortSignal.timeout(15000)});
11 - if(!r.ok)throw Error('Cannot get read-only '+path+' '+r.status);
12 - return r.text();
10 + for(let attempt=0;attempt<3;attempt++){
11 + try{const r=await fetch(host+path,{signal:AbortSignal.timeout(18000)});if(r.ok)return r.text();}
12 + catch(e){if(attempt===2)throw Error('staged_SW_network_unavailable_after_3_attempts');}
13 + if(attempt<2)await new Promise(done=>setTimeout(done,1000*(attempt+1)));
14 + }
15 + throw Error('staged_SW_HTTP_unavailable_after_retries');
16 };
17 const [html,sw]=await Promise.all([check(''),check('sw.js')]);
18 if(!sw.includes("caches.match('/')")||!sw.includes("chartnova-v1"))