fix(core): close Bridges on exit without a fake offline
This commit is contained in:
9 files changed
+92
-8
No files matched your search
@@ -196,4 +196,13 @@ describe('NotificationManager — debounce integration (fake timers)', () => {
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
expect(events).toEqual(['offline']);
|
||||
});
|
||||
|
||||
it('ignores online/offline after dispose so process exit is not a runtime drop', async () => {
|
||||
const { events, mgr } = setup(0);
|
||||
mgr.dispose();
|
||||
mgr.handleOnline('123', 'Bob');
|
||||
mgr.handleOffline('123', 'Bob');
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
expect(events).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -43,7 +43,7 @@ describe('createStateWiring', () => {
|
||||
expect(sub).toHaveBeenNthCalledWith(2, 'connections');
|
||||
});
|
||||
|
||||
it('dispose() unwires onSessionsChanged + BridgeManager listeners (no further publishes)', () => {
|
||||
it('dispose() latches so later Hook/Bridge edges publish nothing', () => {
|
||||
const wiring = createStateWiring();
|
||||
const bm = new BridgeManager();
|
||||
wiring.bindBridgeManager(bm);
|
||||
|
||||
Reference in new issue
Block a user