Describe the bug
In src/helpers/whisperVadConfig.js:
clampVadField(key, value) unconditionally accesses LIMITS[key]:
const { min, max, round } = LIMITS[key];
When an unlisted/extra key is passed (or DEFAULTS has a property not present in LIMITS), it throws:
TypeError: Cannot destructure property 'min' of 'LIMITS[key]' as it is undefined.
resolveContextSileroEnabled(settings, context) performs strict string comparisons against "dictation", "noteRecording", and "meeting". If the context string has surrounding whitespace or uppercase casing (e.g., "DICTATION" or " NoteRecording "), it skips the proper branch and falls through to true.
To Reproduce
- Call
clampVadField("customOption", 10) -> throws TypeError.
- Call
resolveContextSileroEnabled({}, "DICTATION") -> returns true (expected false for dictation).
Expected Behavior
clampVadField should safely return the value or fallback if no limit definition exists.
resolveContextSileroEnabled should normalize the context parameter.
Describe the bug
In
src/helpers/whisperVadConfig.js:clampVadField(key, value)unconditionally accessesLIMITS[key]:const { min, max, round } = LIMITS[key];When an unlisted/extra key is passed (or
DEFAULTShas a property not present inLIMITS), it throws:TypeError: Cannot destructure property 'min' of 'LIMITS[key]' as it is undefined.resolveContextSileroEnabled(settings, context)performs strict string comparisons against"dictation","noteRecording", and"meeting". If the context string has surrounding whitespace or uppercase casing (e.g.,"DICTATION"or" NoteRecording "), it skips the proper branch and falls through totrue.To Reproduce
clampVadField("customOption", 10)-> throwsTypeError.resolveContextSileroEnabled({}, "DICTATION")-> returnstrue(expectedfalsefor dictation).Expected Behavior
clampVadFieldshould safely return the value or fallback if no limit definition exists.resolveContextSileroEnabledshould normalize thecontextparameter.