Skip to content

fix: fall back to defaults for options passed as undefined - #1612

Merged
msluszniak merged 1 commit into
mainfrom
@ms/undefined-option-defaults
Nov 5, 2026
Merged

msluszniak merged 1 commit into
mainfrom
@ms/undefined-option-defaults

Conversation

@msluszniak

Copy link
Copy Markdown
Member

Description

Same bug as #1610 in three more places: an option passed as undefined replaced its default.

  • normalize: native throws INVALID_ARGUMENT.
  • VAD detectVoice: thresholds become NaN, silently returns no segments.
  • Chat session per-turn genConfig: drops the session default (e.g. maxNewTokens becomes unlimited).

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

  • yarn workspace react-native-executorch test __tests__/extensions/normalize.test.ts __tests__/tasks/remainingTasks.test.ts __tests__/tasks/llmChatSession.test.ts
  • The three new tests fail without the src/ changes.

Screenshots

Related issues

#1610, sampler part fixed in #1611.

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

normalize, VAD detectVoice and chat session per-turn config merged options
with an object spread, so an undefined field replaced its default.
@msluszniak msluszniak self-assigned this Nov 5, 2026
@msluszniak msluszniak added the bug fix PRs that are fixing bugs label Nov 5, 2026
@msluszniak
msluszniak requested a review from barhanc November 5, 2026 11:42
@msluszniak
msluszniak merged commit 4b7d6fd into main Nov 5, 2026
7 checks passed
@msluszniak
msluszniak deleted the @ms/undefined-option-defaults branch November 5, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants