Skip to content

clampVadField throws TypeError on unknown keys and resolveContextSileroEnabled misses mixed-case contexts #1925

Description

@hsusul

Describe the bug

In src/helpers/whisperVadConfig.js:

  1. 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.
  2. 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

  1. Call clampVadField("customOption", 10) -> throws TypeError.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions