Summary of What Needs to be Done
Fix a memory leak in src/utils/sseMultiplexer.js inside the claimLocalStorageLeadership() method. The method has a guard if (this.localStorageClaimTimeout || this.isLeader) return that prevents a new timeout from being set, but it does NOT cancel a previously set timeout. Repeated calls to claimLocalStorageLeadership leave orphaned timers in the browser timer queue.
Changes
At the start of claimLocalStorageLeadership, clear any existing this.localStorageClaimTimeout with clearTimeout before setting a new one. This ensures only one pending claim confirmation timer exists at a time.
Impact
Severity: Medium — Timer accumulation in long-running sessions with frequent leadership elections. In multi-tab scenarios with competing leaders, the queue can grow and contribute to memory pressure.
Please assign this task to me.
Summary of What Needs to be Done
Fix a memory leak in src/utils/sseMultiplexer.js inside the claimLocalStorageLeadership() method. The method has a guard if (this.localStorageClaimTimeout || this.isLeader) return that prevents a new timeout from being set, but it does NOT cancel a previously set timeout. Repeated calls to claimLocalStorageLeadership leave orphaned timers in the browser timer queue.
Changes
At the start of claimLocalStorageLeadership, clear any existing this.localStorageClaimTimeout with clearTimeout before setting a new one. This ensures only one pending claim confirmation timer exists at a time.
Impact
Severity: Medium — Timer accumulation in long-running sessions with frequent leadership elections. In multi-tab scenarios with competing leaders, the queue can grow and contribute to memory pressure.
Please assign this task to me.