fix(client): address close() review follow-ups#1075
Merged
Conversation
- subscription_info now rejects on a closed client (raising the same 'client is closed' error every other surface enforces) instead of returning stale 'Unknown' tiers, which hid the closed state. - Correct the TypeScript close() docstring: close() joins the dispatcher (so it can block briefly on an in-flight callback) but does not run the awaitDrain ring barrier — that is the async-disposer path. - Fix a typo (survivng -> surviving). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…efresh the stale rc.5 version guard) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Follow-up to #1074 that aligns post-close() behavior and documentation across the TypeScript and Python bindings, and fixes a small typo in Rust docs.
Changes:
- Update TypeScript
close()documentation to accurately describe synchronous dispatcher join vs. the async-disposerawaitDrainbarrier. - Make Python
subscription_inforeject on a closed client (consistent with other surfaces) instead of returning"Unknown"tiers. - Bump the TypeScript native binding version guard to
13.0.0-rc.13and fix a documentation typo (“survivng” → “surviving”).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| thetadatadx-ts/src/lib.rs | Corrects close() docs to reflect actual streaming teardown semantics (stopStreaming() join vs awaitDrain). |
| thetadatadx-ts/index.js | Updates the native binding version mismatch guard from 13.0.0-rc.5 to 13.0.0-rc.13. |
| thetadatadx-ts/index.d.ts | Keeps the generated TypeScript typings/docs consistent with the updated close() semantics. |
| thetadatadx-py/src/streaming_session.rs | Changes subscription_info to raise on closed client (via client_arc()?) and return PyResult. |
| thetadatadx-py/src/lib.rs | Fixes a spelling typo in Rust doc comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
78
to
82
| const binding = require('thetadatadx-android-arm64') | ||
| const bindingPackageVersion = require('thetadatadx-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '13.0.0-rc.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 13.0.0-rc.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '13.0.0-rc.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 13.0.0-rc.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } |
The regenerated index.js enforces native binding 13.0.0-rc.13, but the lockfile still resolved thetadatadx-darwin-arm64, thetadatadx-linux-x64-gnu, and thetadatadx-win32-x64-msvc at 13.0.0-rc.5. An npm ci honoring the lockfile would install the older native and either trip the enforced version check or run an unexpected native. Align the three resolved entries to rc.13 with their published integrity. 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.
Follow-up to #1074, addressing the Copilot review on that PR.
subscription_infonow rejects on a closed client (raising the same "client is closed" error every other surface enforces) instead of returning stale "Unknown" tiers that hid the closed state.close()docstring is corrected:close()joins the streaming dispatcher (so it can block briefly while an in-flight callback finishes) but does not run theawaitDrainring barrier — that is the async-disposer path.survivng->surviving).Compiles clean for both bindings; fmt clean.