Repository navigation
FIX: Reject unsafe integers in parameter form coercion (#3857) - #3927
Merged
Roman Lutz (romanlutz) merged 2 commits intoNov 8, 2026
Conversation
Validate that integer parameters satisfy Number.isSafeInteger during form coercion, rejecting magnitudes outside the safe integer range before submission instead of silently rounding them into different numbers. Signed-off-by: Hrushikesh Ramilla <ramillahrushikesh@gmail.com>
Copilot started reviewing on behalf of
Hrushikesh Ramilla (Hrushikesh-ramilla)
November 4, 2026 09:25
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to reject unsafe integer inputs before submission.
No open issues 🎉
What changed in this PR
Fixes #3857 by rejecting integer form inputs outside JavaScript’s safe integer range, preventing silent rounding of seeds and other integer parameters before submission.
Changes:
- Adds
Number.isSafeIntegervalidation with a dedicated error message. - Tests unsafe scalar and list values, plus valid safe-integer boundaries.
- Extends dialog coverage to verify unsafe seed input blocks submission.
| File | Description |
|---|---|
frontend/src/components/Registry/CreateConverterDialog.test.tsx |
Verifies unsafe seed input displays an error and prevents submission. |
frontend/src/components/Parameters/parameterForm.ts |
Rejects unsafe integers during parameter coercion. |
frontend/src/components/Parameters/parameterForm.test.ts |
Tests unsafe integer rejection and safe boundary acceptance. |
Review effort: Balanced
Roman Lutz (romanlutz)
approved these changes
Nov 8, 2026
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 #3857.
When integer parameters (such as
seedonRandomCapitalLettersConverter) are coerced from string inputs incoerceToken, values exceeding the safe integer range (Number.MAX_SAFE_INTEGER/Number.MIN_SAFE_INTEGER) were previously accepted byNumber.isInteger, causing JavaScript's IEEE-754 representation to silently round them into different integers (e.g.9007199254740993becoming9007199254740992).This change adds a
Number.isSafeIntegercheck tocoerceTokenfortypeName === 'int', returning an error (${paramName} must be a safe integer.) when values exceed supported safe integer bounds, preventing silent mutation of reproducibility seeds and integer configurations.Tests and Documentation
frontend/src/components/Parameters/parameterForm.test.tsverifying rejection of unsafe integers aboveNumber.MAX_SAFE_INTEGERand belowNumber.MIN_SAFE_INTEGER, as well as acceptance of safe integer boundary values (9007199254740991and-9007199254740991).parameterForm.test.tsverifying rejection of unsafe integers inlist[int]parameters.frontend/src/components/Registry/CreateConverterDialog.test.tsxverifying that entering9007199254740993forseedsurfaces the safe integer validation error and aborts submission.npm run type-checkandnpm run lint.