Repository navigation
6.0: historical_news takes total_results: u16, not u8 - #1190
Merged
Merged
Conversation
`Client::historical_news` (async and blocking) takes `total_results: u16`. Previously `u8` capped a request at 255, below the 300 that IB documents as the maximum. CHANGELOG and migration guide.
tradatious
force-pushed
the
api_b_news-total-results-u16
branch
from
November 5, 2026 22:42
279a92e to
7e956fc
Compare
Async historical_news gets the sync Arguments block. Both note TWS caps at 300 silently and rejects 0 with 321 (live 2026-11-05, server 226). Wire fact in docs/wire-facts/news.md; migration §21 cites it.
# Conflicts: # CHANGELOG.md # docs/migration-6.0.md
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.
Description
Client::historical_news(async and blocking) tooktotal_results: u8, so a caller could request at most 255 headlines. IB documents the parameter as "int. The maximum number of headlines to fetch (1 – 300)" (interactivebrokers.com/docs/tws-api/doc/news/historical-news-headlines/requesting-historical-news), and the blocking method's rustdoc says the same. The parameter is nowu16. No range check. A live probe (paper, server 226, 2026-11-05) settled the range: TWS returns at most 300 headlines for any larger value (301, 500, 1000, 65535), with no notice, and rejects 0 with error 321 "Total results must be > 0". The async and blocking rustdoc, migration §21 anddocs/wire-facts/news.mdrecord this. The encoder converts withi32::from, so the compiler checks that the widening is lossless.Testing
cargo fmt --checkcargo clippy --all-targets -- -D warnings(default,--no-default-features --features sync,--all-features)cargo doc --no-depswithRUSTDOCFLAGS="-D warnings"(same three configurations)cargo test(same three configurations)cargo build --examples(same three configurations)cargo build -p ibapi-integration-sync --tests,cargo build -p ibapi-integration-async --testscargo clippy -p ibapi-integration-sync --tests -- -D warnings,cargo clippy -p ibapi-integration-async --tests -- -D warningsAll pass on the change; after the rebase onto current main,
cargo clippy --all-targets --all-features -- -D warningsandcargo test --all-featuresagain.Breaking changes
Yes. A caller passing a typed
u8fortotal_resultsmust pass au16instead (n.into()converts au8); integer literals and untypedletbindings compile unchanged. Migration §21.