Repository navigation
fix: keep falsy step values, the final voice transcript and cached validators - #396
Merged
Merged
Conversation
…lidators - triggerNextStep saves 0, false and '' as the step value (only undefined means no value), so trigger functions and handleEnd receive them - speech recognition sends the final transcript before it ends, and automatic submission works again after the user stopped a recognition - a cached conversation restores the validator of the step waiting for the user input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes four bugs found while writing the new documentation (#395). They were already in 0.x.
triggerNextStep({ value })ignored0,falseand'', so the step had no value,{previousValue}and trigger functions gotundefined, andhandleEndleft them out ofvalues. Now onlyundefinedmeans "no value". This also fixes trigger functions of options whose value is falsy (e.g.{ label: 'No', value: false }).validatorof that step was gone (functions are not cached), so invalid answers were accepted.Related issue
None.
Type of change
feat: new featurefix: bug fixdocs: documentationrefactor/perf/testbuild/ci/chore!, and the migration is described below)How has this been tested?
A failing test was written first for each bug, then fixed:
0,falseand''are kept as step values and reachhandleEnd(3 cases)Lint, typecheck, build and the 93 tests pass.
Bumps the version to 1.0.1.
Breaking changes
None.
handleEndvaluesnow include falsy values, which were missing before.Checklist
npm run lint,npm run typecheckandnpm testpass