Description
Same bug as the desktop app's bus — the unsubscribe closure uses splice(indexOf(handler), 1) without guarding against indexOf returning -1. A double-unsubscribe removes the wrong handler.
Steps to reproduce
- Subscribe two handlers to the same runId via CLI bus
- Call the first handler's unsubscribe twice
- Second handler gets removed
Expected behavior
Double-unsubscribe should be a no-op.
Actual behavior
splice(-1, 1) removes the last element — the wrong handler.
Description
Same bug as the desktop app's bus — the unsubscribe closure uses
splice(indexOf(handler), 1)without guarding against indexOf returning -1. A double-unsubscribe removes the wrong handler.Steps to reproduce
Expected behavior
Double-unsubscribe should be a no-op.
Actual behavior
splice(-1, 1)removes the last element — the wrong handler.