๐Ÿ› [BUG]: Reject non-finite volume percentages #69

Closed
opened 2026-06-22 09:43:38 +00:00 by FrauJulian ยท 0 comments
FrauJulian commented 2026-06-22 09:43:38 +00:00 (Migrated from github.com)

Description

AudioManager#setVolume() rejects values below 0 and above 100, but non-finite numbers such as NaN, Infinity, and -Infinity can pass the current range check. That can forward invalid volume values to resource.volume.setVolume().

Affected code: src/audio-manager.ts in setVolume().

Acceptance Criteria

  • setVolume() rejects NaN, Infinity, and -Infinity with AudioManagerConfigError.
  • Existing valid boundary values still work: 0 and 100.
  • Add a focused Jest regression test for non-finite volume values.
### Description `AudioManager#setVolume()` rejects values below `0` and above `100`, but non-finite numbers such as `NaN`, `Infinity`, and `-Infinity` can pass the current range check. That can forward invalid volume values to `resource.volume.setVolume()`. Affected code: `src/audio-manager.ts` in `setVolume()`. ### Acceptance Criteria - `setVolume()` rejects `NaN`, `Infinity`, and `-Infinity` with `AudioManagerConfigError`. - Existing valid boundary values still work: `0` and `100`. - Add a focused Jest regression test for non-finite volume values.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: fraujulian/Discord-Audio-Stream#69