From 87b61463f3382a33bba4053431b90390842153f0 Mon Sep 17 00:00:00 2001 From: KallyDev Date: Sun, 12 Apr 2026 22:47:13 +0900 Subject: [PATCH] fix: correct QuoteContext cache expiry checks --- CHANGELOG.md | 1 + rust/src/quote/cache.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b86e1086..591d4b79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Fixed +- **Rust:** Fix incorrect cache expiry checks in `QuoteContext`. - **All bindings:** Correct `SecurityStaticInfo.dividend_yield` doc comment from "Dividend yield" (ratio) to "Dividend" (per share amount) across all language SDKs (Rust, Python, Node.js, Java, C, C++). - **All bindings:** `create_topic` now returns the topic ID (`String`) instead of `OwnedTopic` to avoid deserialization errors when the API response omits optional fields. diff --git a/rust/src/quote/cache.rs b/rust/src/quote/cache.rs index 33450e9c2..f3c17d54f 100644 --- a/rust/src/quote/cache.rs +++ b/rust/src/quote/cache.rs @@ -42,7 +42,7 @@ where { let mut inner = self.inner.lock().await; match inner.values.get(&key) { - Some(Item { deadline, value }) if deadline < &Instant::now() => Ok(value.clone()), + Some(Item { deadline, value }) if deadline > &Instant::now() => Ok(value.clone()), _ => { let value = f(key.clone()).await?; let deadline = Instant::now() + inner.timeout;