Repository navigation
fix(bindings/nodejs): reject invalid BigInt chunk and gap options - #9604
Open
rohan4naik wants to merge 1 commit into
Open
rohan4naik wants to merge 1 commit into
rohan4naik wants to merge 1 commit into
Conversation
Xuanwo
approved these changes
Dec 3, 2026
Member
|
Could you merge or rebase current (AI-generated comment) |
This branch has not been deployed
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.
Which issue does this PR close?
Closes #9569.
Rationale for this change
On the baseline, the Node.js binding accepts
-1nand1n << 64nfor writechunkand read/readergap. Sixteen new regression cases fail because the calls succeed rather than returnInvalidArg.What changes are included in this PR?
Use the generator's existing
UsizeBigIntmapping for these three fields, regenerate the option structs and declarations, and remove the unused lossy mapping. This reusesbigint_to_usize, asCopyOptions.chunkdoes, instead of adding validation to individual operation entry points.Tests cover rejection in all eight async/sync methods, unchanged stored content after rejected writes, and valid zero values. Surface tests now use valid values where they previously asserted truncation.
Local validation: debug native build; full memory-backed Vitest suite (617 passed, 114 capability-dependent skips); all 199 development-tool tests; 3 binding Rust tests; binding Clippy with warnings denied; Rust formatting and Prettier on changed tests. Other storage services and 32-bit targets were not exercised.
Are there any user-facing changes?
Negative or overflowing
chunk/gapBigInts returnInvalidArg. Zero remains accepted. TypeScript signatures are unchanged; generated documentation describes the validation.Breaking changes
AI Usage Statement