rowboatlabs / rowboatlabs/rowboat
CLI Bus.unsubscribe has same splice(-1) bug as desktop app
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 1.7k
- Avg merge
- 11h 37m
- Merged PRs (30d)
- 173
Description
### 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
1. Subscribe two handlers to the same runId via CLI bus
2. Call the first handler's unsubscribe twice
3. 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Find the CLI bus implementation and its unsubscribe closure, then compare it with the desktop app's bus behavior described in the issue. Reproduce the two-handler, double-unsubscribe case and verify that the second handler remains subscribed and the repeated unsubscribe is a no-op.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100