Skip to content

Commit 54a3cd1

Browse files
userFRMclaude
andauthored
fix(client): address close() review follow-ups (#1075)
* fix(client): address close() review follow-ups - 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> * build(ts): regenerate index.d.ts for the corrected close() doc (and refresh the stale rc.5 version guard) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(ts): pin platform native packages to rc.13 in the lockfile 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> --------- Co-authored-by: preview <noreply@anthropic.com>
1 parent 10869b2 commit 54a3cd1

6 files changed

Lines changed: 87 additions & 86 deletions

File tree

thetadatadx-py/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ struct Client {
689689
///
690690
/// The inner `thetadatadx::Client` is not `Clone` — its streaming mutex and
691691
/// subscription-tier state forbid it — so surfaces co-own a cheap
692-
/// `Arc<Client>` clone (survivng past a parent close, exactly as the C++
692+
/// `Arc<Client>` clone (surviving past a parent close, exactly as the C++
693693
/// `Historical` / `Stream` views co-own the `shared_ptr`).
694694
///
695695
/// Deadlock-safe drop: the core `Client::Drop` runs the DETACHED streaming

thetadatadx-py/src/streaming_session.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,21 +279,16 @@ impl crate::Client {
279279
///
280280
/// Mirrors the upstream
281281
/// [`thetadatadx::Client::subscription_info`] shape.
282-
fn subscription_info(&self) -> Vec<(String, String)> {
283-
// A closed client holds no live auth payload; report `Unknown` per
284-
// asset class rather than raising from a plain diagnostic getter.
285-
let Ok(client) = self.client_arc() else {
286-
return ["stock", "options", "indices", "interest_rate"]
287-
.into_iter()
288-
.map(|asset| (asset.to_string(), "Unknown".to_string()))
289-
.collect();
290-
};
291-
let info = client.subscription_info();
292-
vec![
282+
fn subscription_info(&self) -> PyResult<Vec<(String, String)>> {
283+
// A closed client rejects further use, consistent with every other
284+
// surface; `client_arc()` raises the "client is closed" error rather
285+
// than returning stale/`Unknown` data that would hide the closed state.
286+
let info = self.client_arc()?.subscription_info();
287+
Ok(vec![
293288
("stock".to_string(), info.stock),
294289
("options".to_string(), info.options),
295290
("indices".to_string(), info.indices),
296291
("interest_rate".to_string(), info.interest_rate),
297-
]
292+
])
298293
}
299294
}

thetadatadx-ts/index.d.ts

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)