fix: preserve error sources and align cross-binding strike and park-interval widths#818
Merged
Conversation
…nterval widths Bridge the data-format and per-cell decode errors into the public Error with the typed cause carried as a thiserror source instead of flattening it to a string, so std::error::Error::source() walks the chain for the Config and Decode families the way it already does for the IO, HTTP, and TLS variants. The credentials-file read also carries its underlying io::Error as the source. Display output is unchanged: the kind and message fields still render exactly as before, and the gRPC status conversion already preserves the code, message, and retry hint structurally so it needs no source link. Correct the Contract::from_str bare-root rustdoc to state the real length bound: validate_root accepts 1..=16 ASCII uppercase characters (MAX_ROOT_LEN), not 1..=6. Compare the flat-file CSV against the vendor reference column-for-column rather than as a raw byte block. The SDK emits option strikes in dollars on every client-facing surface while the vendor file renders the raw scaled-integer wire value, so the strike column is compared on a common scale and every other byte must still match exactly. Widen the TypeScript wait_park_us binding to a BigInt so the microsecond park interval marshals as the u64 it is in the core, matching the Python, C, and C++ bindings and the other microsecond and second streaming and reconnect knobs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…setter The committed type stub carried a stale tsdoc block for `setWaitParkUs` / `waitParkUs` after the park interval widened to a 64-bit microsecond value. Regenerate the stub from the native build so the published types match the doc comments the binding actually emits, restoring parity between the committed `.d.ts` and the generator output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
A batch of small correctness and consistency fixes across the error surface, contract docs, the flat-file byte-match test, and the TypeScript binding.
Error cause-chain preservation
The bridges from the data-format encoding layer and the per-cell decoder into the public
Errorpreviously flattened the typed cause to a string, sostd::error::Error::source()returnedNonefor theConfigandDecodefamilies — inconsistent with theIo/Http/Tlsvariants that carry their cause via#[from]. TheConfigandDecodevariants now hold an optional#[source]boxed error that theFromconversions populate with the typed cause, so chain walkers reach the original error without parsingDisplay. The credentials-file read carries its underlyingio::Errorthe same way. Display output is unchanged:kindandmessagerender exactly as before, verified by the existing kind-carried tests. The gRPC status conversion already preserves the numeric code, message, and retry hint structurally, so it gains a clarifying comment rather than a redundant source link.Contract::from_str rustdoc
The bare-root doc claimed
1..=6 ASCII uppercase, butvalidate_rootaccepts1..=MAX_ROOT_LEN(16). Corrected to match the code.Flat-file byte-match comparison
The opt-in live byte-match compared the SDK CSV against the vendor reference as one byte block. The SDK emits option strikes in dollars on every client-facing surface while the vendor file renders the raw scaled-integer wire value (1000 wire units per dollar), so the strike column can never byte-match. The comparison is now column-for-column: the strike cell is compared on a common scale, and every other byte must still match exactly. The test stays behind its
live-testsfeature gate and the fixtures env var.TypeScript wait_park_us width
The napi binding typed
wait_park_usasu32while the core field, and the Python, C, and C++ bindings, are allu64. Widened the binding to aBigInt, mirroring the other microsecond and second streaming and reconnect knobs, so all four bindings match the core width.Verification
cargo fmt --all -- --checkclean (core and TypeScript crate)cargo test -p thetadatadx --lib— 808 passed, including the two newerror::tests::*_bridge_preserves_sourcetestscargo clippy -p thetadatadx --lib -- -D warningscleancargo check -p thetadatadx --test flatfiles_byte_match --features live-testscompilescargo buildon the TypeScript binding crate succeeds🤖 Generated with Claude Code