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 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-02 12:57:12 -05:00
parent 451bd50eb3
commit b43d3ba1af
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -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'){