[object Object]

← back to Commercialrealestate

CRCP: retry ranked.json fetch-only so success body (12 event listeners) runs once — fixes double-wire regression (Cody HOLE-1)

f05ff591f5e7b35ea9266bf6a296670be7988865 · 2026-08-06 16:21:27 -0700 · Steve Abrams

Files touched

Diff

commit f05ff591f5e7b35ea9266bf6a296670be7988865
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 6 16:21:27 2026 -0700

    CRCP: retry ranked.json fetch-only so success body (12 event listeners) runs once — fixes double-wire regression (Cody HOLE-1)
---
 public/index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/index.html b/public/index.html
index 529d57d..4a6c764 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1888,7 +1888,7 @@ function mapCondo(c){
     beds:c.beds, baths:c.baths, sqft:c.sqft, hoa:c.hoa, broker_name:c.broker_name,
     project_name:c.project_name, upside_note:null, qwen:null };
 }
-function loadRanked(_retry){ fetch('data/ranked.json').then(r=>{ if(!r.ok) throw new Error('HTTP '+r.status); return r.json(); }).then(async d=>{
+function loadRanked(_retry){ return fetch('data/ranked.json').then(r=>{ if(!r.ok) throw new Error('HTTP '+r.status); return r.json(); }).catch(e=>{ if(_retry>0){ return new Promise(res=>setTimeout(res,1500)).then(()=>loadRanked(_retry-1)); } throw e; }); } loadRanked(1).then(async d=>{
   DATA=d; if(window.__comps) DATA.comps=window.__comps;
   // Merge condo inventory in-grid (best-effort; explorer still works if the API is down).
   let condoN=0; try{ const cd=await (await fetch('/api/condos')).json(); const cs=(cd.condos||[]).map(mapCondo); condoN=cs.length; DATA.ranked=DATA.ranked.concat(cs); }catch(e){}
@@ -2011,7 +2011,7 @@ function loadRanked(_retry){ fetch('data/ranked.json').then(r=>{ if(!r.ok) throw
 
   window.DATA_READY = true;
   recompute(); syncChips(); render();
-}).catch(e=>{ if(_retry>0){ setTimeout(()=>loadRanked(_retry-1),1500); return; } $('#sub').textContent='Listings are still loading — refresh in a moment if this persists.'; console.warn('ranked.json load failed:',e); }); } loadRanked(1);
+}).catch(e=>{ $('#sub').textContent='Listings are still loading — refresh in a moment if this persists.'; console.warn('ranked.json load failed:',e); });
 </script>
   <script src="/col-resize.js" defer></script>
   <script src="/global-search.js" defer></script>

← 00b8192 CRCP: soften dev-facing load errors + one-shot auto-retry on  ·  back to Commercialrealestate  ·  CRCP: per-property public-record enrichment module (free ass 4d95c1e →