Reconcile dashboard online presence against complete live roster
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user