fix: handle IB formatted timestamps and optional realtime integer fields#443
Merged
wboayue merged 6 commits intowboayue:mainfrom Apr 9, 2026
Merged
fix: handle IB formatted timestamps and optional realtime integer fields#443wboayue merged 6 commits intowboayue:mainfrom
wboayue merged 6 commits intowboayue:mainfrom
Conversation
Contributor
Author
|
should I do the PR on top of v2-stable instead ? |
- next_date_time delegates to next_date_time_with_timezone(None), remove parse_ib_date_time wrapper - move StreamDecoder impls for BidAsk, MidPoint, Bar, Trade, MarketDepths, TickTypes from async.rs to mod.rs, remove cfg guards since one of sync/async is always enabled
…tests, add double-space comment
wboayue
added a commit
that referenced
this pull request
Apr 9, 2026
* fix: handle IB formatted timestamps and optional realtime integer fields * fix clippy needless_borrow warnings for NEW_YORK references * deduplicate StreamDecoder impls and next_date_time method - next_date_time delegates to next_date_time_with_timezone(None), remove parse_ib_date_time wrapper - move StreamDecoder impls for BidAsk, MidPoint, Bar, Trade, MarketDepths, TickTypes from async.rs to mod.rs, remove cfg guards since one of sync/async is always enabled * revert optional int decoding — C# reference uses ReadInt() for all fields * rename decode_head_timestamp_with_timezone to decode_head_timestamp * add embedded timezone tests, error on unrecognized tz, use skip() in tests, add double-space comment --------- Co-authored-by: Wil Boayue <wil.boayue@gmail.com>
wboayue
added a commit
that referenced
this pull request
Apr 10, 2026
* clean up CLAUDE.md: fix clippy commands, remove duplication, reorder sections, add branches and doc maintenance policy * fix: timezone-aware IB timestamp parsing and StreamDecoder dedup (#443) * fix: handle IB formatted timestamps and optional realtime integer fields * fix clippy needless_borrow warnings for NEW_YORK references * deduplicate StreamDecoder impls and next_date_time method - next_date_time delegates to next_date_time_with_timezone(None), remove parse_ib_date_time wrapper - move StreamDecoder impls for BidAsk, MidPoint, Bar, Trade, MarketDepths, TickTypes from async.rs to mod.rs, remove cfg guards since one of sync/async is always enabled * revert optional int decoding — C# reference uses ReadInt() for all fields * rename decode_head_timestamp_with_timezone to decode_head_timestamp * add embedded timezone tests, error on unrecognized tz, use skip() in tests, add double-space comment --------- Co-authored-by: Wil Boayue <wil.boayue@gmail.com> * require PRs for changes to main and v2-stable * fix: add-british-summer-time-zone-mapping (#445) * fix: add-british-summer-time-zone-mapping * refactor timezone mapping to table-driven lookup --------- Co-authored-by: kinz <keith.kinz@gmail.com> Co-authored-by: Wil Boayue <wil.boayue@gmail.com> * fix: improve error context for parsing failures (#440) * fix(messages): improve error context for parsing failures - Wrap parse() calls in next_date_time() with Error::Parse to include field index and value - Fix parse_unix_timestamp() to provide error context instead of generic ParseIntError - Fix parse_bar_date() to provide error context instead of generic ParseIntError This changes error messages from: 'invalid digit found in string' to: 'parse error: <field_index> - <field_value> - <parse_error>' Making it much easier to debug which IBKR message field is causing parsing issues. Fixes issues where symbols like GOOGL, BTC, QCOM fail during subscription with opaque 'invalid digit found in string' errors. * test: add coverage for parse_bar_date and parse_unix_timestamp --------- Co-authored-by: Wil Boayue <wil.boayue@gmail.com> * fix: propagate time-in-force to bracket order child orders (#444) * bump version to 2.11.0 * refactor: move Client methods into domain modules Move domain-specific impl Client methods from monolithic client/sync.rs and client/async.rs into their respective domain modules (accounts, contracts, orders, market_data, news, scanner, display_groups, wsh). Eliminates standalone delegation functions and pub mod blocking re-exports. New API methods no longer require touching the client files. * docs: update for domain module pattern Update CLAUDE.md, extending-api.md, and api-patterns.md to reflect that Client methods now live as impl blocks in domain modules, not as standalone functions with blocking re-exports. * remove completed todo * fix: make verify_contract an impl Client method for sync/async consistency * deduplicate: extract shared logic to common modules - Extract verify_contract to contracts/common/verify.rs (was duplicated in sync.rs and async.rs) - Move StreamDecoder impls to common/stream_decoders.rs for orders, news, and scanner (were duplicated between sync.rs and async.rs with cfg gates) * fmt: fix import ordering * fix: gate sync-only test tables and remove unused imports for CI * docs: match clippy flags to CI in CLAUDE.md --------- Co-authored-by: faysou <faysal.aberkane@gmail.com> Co-authored-by: Keith Liu <135390672+kinz-dev@users.noreply.github.com> Co-authored-by: kinz <keith.kinz@gmail.com> Co-authored-by: Vijay Singh <singhvjd@gmail.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.
Summary
src/messages.rs, covering Unix timestamps, UTC-formattedyyyyMMdd-HH:mm:ssvalues, timestamps with embedded timezone names, session-localyyyyMMdd HH:mm:ssvalues, and date-onlyyyyyMMddvalues when a session timezone is available.IncomingMessages::Errorfor realtime bars and by switching several decoder integer reads tomessage.next_optional_int()?.unwrap_or_default(), so omitted fields such as bar counts, tick attribute masks, market-depth positions, operations, and sides default to zero instead of failing on empty fields.Design notes
20260328-12:34:56.YYYYMMDDvalues from being misread as 1970-era epoch seconds.Testing
cargo test --features synccargo test --features asynccargo fmt --all