From b43d3ba1af2ece8b8a7b48f99e56d8f05f72eb0f Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 2 Oct 2026 12:57:12 -0500 Subject: [PATCH] Placement switch: drop the cached member view on change and redraw fresh (Clinton #218 saw 'Team rotation' for up to 2 min after choosing Direct) Co-Authored-By: Claude Opus 5.5 --- public/my.html | 2 +- public/my.js | 2 +- server.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/my.html b/public/my.html index 09b1d33..b05d668 100644 --- a/public/my.html +++ b/public/my.html @@ -31,5 +31,5 @@
All figures are read live from the RM Circle smart contract on Polygon and are historical facts, not a promise of future results. Participation involves cryptocurrency and smart-contract risk. Never use funds you cannot afford to lose.
- + diff --git a/public/my.js b/public/my.js index d44831a..56b9720 100644 --- a/public/my.js +++ b/public/my.js @@ -849,7 +849,7 @@ try{ const r=await (await fetch('/api/public/placement',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({mode:m})})).json(); if(r&&r.error){ const ex=document.getElementById('plExplain'); if(ex)ex.textContent=r.error; return; } - load(d.id); // redraw from the server so the panel and the copy can never disagree + try{sessionStorage.setItem('rmc.fresh','1')}catch(e){} load(d.id); // redraw from the server (cache-bypassing) so the panel and the copy can never disagree }catch(e){} }; const bt=document.getElementById('plTeam'), bd=document.getElementById('plDirect'); diff --git a/server.js b/server.js index 0a0b671..189223b 100644 --- a/server.js +++ b/server.js @@ -1586,6 +1586,7 @@ async function handleApi(req,res,pathname){ if(!ps)return json(res,401,{error:'Not signed in.'}); const pb=await bodyJson(req).catch(()=>null); const pr=placement.set(ps.id,pb&&pb.mode); + try{ memberCache.delete(String(ps.id)); memberCache.delete(Number(ps.id)); }catch(e){} // the dashboard redraws right after; never from the stale copy (Clinton #218, 2026-10-02) return json(res,pr.error?400:200,pr); } if(req.method==='POST'&&pathname==='/api/public/profile/username'){