Repository navigation
fix(csv-stringify): report record access errors through streams - #566
Open
krish-goradia wants to merge 1 commit into
Open
krish-goradia wants to merge 1 commit into
krish-goradia wants to merge 1 commit into
Conversation
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.
Fixes #565.
A record getter or Proxy can throw during field access or automatic column discovery. Those exceptions currently escape
_transform; with the callback API they escape the scheduled writer and terminate the process without calling the supplied error callback. Directwrite()also throws despite an attached stream error listener.Catch exceptions from the record transformation and pass them through the existing transform callback and stop state, just as returned casting errors are handled. Keep the transform callback outside the
tryblock.Six subprocess checks cover getters and column-discovery traps through callback, direct-write, and pipeline APIs. The four callback/write cases fail before the fix; the two pipeline cases already pass and guard existing behavior. Callback checks also verify that the original error is delivered exactly once.
Validation on Node.js 26.4.0:
lerna run testscoped tocsv,csv-generate,csv-parse,csv-stringify, andstream-transform), including TypeScript checks.csv-stringifybuild passes; rebuilt CommonJS and ESM bundles deliver the original getter error to the callback. Generated distributions are left to the release build process.demo/issues-esm/lib/441.jsexample cannot load DuckDB's native binding after dependency installation with scripts disabled. The library package run above passes independently.AI assistance: Codex helped reproduce the bug, implement the fix, write the tests, and prepare this description.