mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: clear qualityDebounceTimer on connectionStats stop (BUG-071B)
The quality debounce timer could fire after the stats poller was stopped, calling listeners against a dead room. Sub-issues A (autoplay listener) and C (VAD timer) were already fixed in prior work.
This commit is contained in:
@@ -190,6 +190,12 @@ export function createConnectionStatsPoller(getRoom: () => Room | null): Connect
|
||||
log.info("Stopping connection stats poller");
|
||||
clearInterval(intervalId);
|
||||
intervalId = null;
|
||||
// BUG-071B: Clear pending quality debounce timer to prevent it firing
|
||||
// after the poller is stopped (would call listeners against a dead room).
|
||||
if (qualityDebounceTimer !== null) {
|
||||
clearTimeout(qualityDebounceTimer);
|
||||
qualityDebounceTimer = null;
|
||||
}
|
||||
current = EMPTY_STATS;
|
||||
prev = { timestamp: Date.now(), outBytes: 0, inBytes: 0 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user