AudioManager.connect() creates and subscribes a new voice connection, then awaits entersState(...Ready...). If that await rejects, for example on a timeout, the new connection remains stored on the manager and playbackState remains connecting.
src/audio-manager.ts:92 awaits readiness without cleanup on rejection
Impact: callers can observe isConnected === true even though readiness failed, and the Discord voice connection can stay alive until the process or caller explicitly disposes the manager.
Acceptance Criteria
If entersState rejects, the newly-created connection is destroyed or disconnected.
this.connection is cleared when the connection was not ready.
The manager leaves a consistent state such as stopped or idle after a failed connect attempt.
The original connection failure still rejects to the caller.
Add a focused test that mocks entersState rejection and asserts connection cleanup plus final state.
## Description
`AudioManager.connect()` creates and subscribes a new voice connection, then awaits `entersState(...Ready...)`. If that await rejects, for example on a timeout, the new connection remains stored on the manager and `playbackState` remains `connecting`.
Evidence:
- `src/audio-manager.ts:83` sets `playbackState = 'connecting'`
- `src/audio-manager.ts:86` assigns `this.connection = joinVoiceChannel(...)`
- `src/audio-manager.ts:92` awaits readiness without cleanup on rejection
Impact: callers can observe `isConnected === true` even though readiness failed, and the Discord voice connection can stay alive until the process or caller explicitly disposes the manager.
## Acceptance Criteria
- If `entersState` rejects, the newly-created connection is destroyed or disconnected.
- `this.connection` is cleared when the connection was not ready.
- The manager leaves a consistent state such as `stopped` or `idle` after a failed connect attempt.
- The original connection failure still rejects to the caller.
- Add a focused test that mocks `entersState` rejection and asserts connection cleanup plus final state.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
AudioManager.connect()creates and subscribes a new voice connection, then awaitsentersState(...Ready...). If that await rejects, for example on a timeout, the new connection remains stored on the manager andplaybackStateremainsconnecting.Evidence:
src/audio-manager.ts:83setsplaybackState = 'connecting'src/audio-manager.ts:86assignsthis.connection = joinVoiceChannel(...)src/audio-manager.ts:92awaits readiness without cleanup on rejectionImpact: callers can observe
isConnected === trueeven though readiness failed, and the Discord voice connection can stay alive until the process or caller explicitly disposes the manager.Acceptance Criteria
entersStaterejects, the newly-created connection is destroyed or disconnected.this.connectionis cleared when the connection was not ready.stoppedoridleafter a failed connect attempt.entersStaterejection and asserts connection cleanup plus final state.