fix: use defaults for blank number ingredients - #2707
Open
Adamkadaban wants to merge 1 commit into
Open
Conversation
Contributor
|
Could you give an example, in the PR description, of an example problem recipe/link that this patch is intended to remediate. |
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
Blank number inputs are serialized as
NaN, causing recipe hydration to fail before the operation runs. This change uses the ingredient's configured default for actual numericNaNvalues while continuing to reject invalid strings such as"NaN".Existing Issue
None. This is a follow-up to #1866, which added the Offset ingredient to Add line numbers.
The issue only occurs when a user has a blank offset in the "Add line numbers" operation.
eg. https://gchq.github.io/CyberChef/#recipe=Add_line_numbers(null)&input=ZXJyb3Igd2hlbiBjaGFuZ2luZyAiT2Zmc2V0IiBmaWVsZA
Screenshots
Error produced when the Offset number input is blank:
AI disclosure
I used GitHub Copilot CLI (GPT-5.6 Sol) to investigate the stack trace, draft the change, and add regression tests. I reviewed the patch and ran the full test suite.
Test Coverage
npm run lintnpm test(274/274 Node API tests and 2280/2280 operation tests)npm run testnodeconsumernpm run buildnpm run testui(2046 assertions passed)