Reconcile dashboard online presence against complete live roster

This commit is contained in:
Codex
2026-09-22 16:30:45 -04:00
parent 360f164905
commit ce6b38f3bb
4 changed files with 46 additions and 6 deletions
+13
View File
@@ -79,3 +79,16 @@ test('unverified bridge death fails safe without erasing identity',async()=>{
assert.equal(bot.death,undefined);
}finally{connectors.simulation=old;}
});
test('complete roster clears stale presence and historical events cannot restore it',async()=>{
const store=new Store();
const payload={name:'Rosterbot',isBot:true,characterGuid:123,accountId:2,className:'Death Knight',raceName:'Orc',level:55};
await applyAuthoritativeAleEvent(store,'player.snapshot',payload);
await applyAuthoritativeAleEvent(store,'player.snapshot',{roster:true,observedAt:100,characterGuids:[123]});
assert.equal(store.state.bots.filter(b=>b.status==='online').length,1);
await applyAuthoritativeAleEvent(store,'player.snapshot',{roster:true,observedAt:101,characterGuids:[]});
for(const kind of ['player.login','player.snapshot','player.zone'])await applyAuthoritativeAleEvent(store,kind,payload);
assert.equal(store.state.bots.filter(b=>b.status==='online').length,0);
await applyAuthoritativeAleEvent(store,'player.snapshot',{roster:true,observedAt:100,characterGuids:[123]});
assert.equal(store.state.bots.filter(b=>b.status==='online').length,0);
});