fix(trade): page history_executions through all has_more results - #591
Merged
Merged
Conversation
hogan-yuan
force-pushed
the
fix-history-executions-pagination
branch
2 times, most recently
from
September 11, 2026 05:39
5c3205b to
492d304
Compare
The endpoint caps each response at 1000 records. `history_executions` deserialized just the first page's `trades` and returned it, silently truncating windows with >1000 fills. Walk the `page` parameter (1-based, verified against production) until `has_more` is false, deduping by `trade_id` as a guard. Bounded to 1000 pages as a runaway guard. The blocking wrapper and all language bindings delegate to this and get it for free.
hogan-yuan
force-pushed
the
fix-history-executions-pagination
branch
from
September 11, 2026 06:02
492d304 to
eea924d
Compare
Merged
hogan-yuan
added a commit
that referenced
this pull request
Sep 14, 2026
Release **v5.0.0**. Bumps the workspace version `4.5.0` → `5.0.0` and closes out the `[Unreleased]` CHANGELOG section as `[5.0.0] - 2026-09-14`. Major bump: this release carries breaking API changes across every language binding. Base includes everything on `main` through #581 (the `comparison_symbols` switch, verified live against production) and #591 (`history_executions` paging). ### Breaking changes (7) - Removed `GridContext.submit_strategy_questionnaire` (`POST /v1/record/questionnaire`) and `SubmitStrategyQuestionnaireOptions` across all bindings. - `WarrantStatus` gains an `Unknown` variant (first variant) — shifts the ordinal of existing variants in C/C++/Java/Node.js/Python. - `WarrantInfo.expiry_date` is now optional (empty server dates no longer fail the whole `warrant_list`). - `FundamentalContext.industry_rank` takes typed `IndustryRankIndicator` / `IndustryRankSortType` (+ `Market`) instead of three free-form strings. - `FundamentalContext.us_financial_statement` takes a typed `FinancialStatementKind` instead of a free-form `kind` string. - Write methods on `AlertContext` (`add`/`update`/`delete`) and `SharelistContext` (`delete`/`add_securities`/`remove_securities`/`sort_securities`) now return `()` / `void` / `Promise<void>`. - `FundamentalContext.ratings` (`GET /v1/quote/ratings`) is temporarily unavailable (server-side 暂不开放) — commented out across all bindings; `StockRatings` types retained. Added (7), Changed (14), and Fixed (12) are detailed in `CHANGELOG.md`. ### Changelog housekeeping Consolidated the interleaved duplicate `[Unreleased]` section headers (`Breaking changes` ×2, `Fixed` ×3) into one section each, ordered Breaking → Added → Changed → Fixed, and removed 4 duplicate Fixed entries (the C/C++ null-pointer, C++ `AssetContext`, and C `lb_statement_item_t` items each appeared twice). No entry content was dropped other than the duplicates. Added one new entry for #581 under Changed. ### To publish after merge 1. Fast-forward the `release` branch to the merge commit: `git push origin <merge-sha>:release` (triggers the Release workflow → crates.io / PyPI / npm / Maven Central / S3).
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.
Problem
/v1/trade/execution/historycaps each response at 1000 records.history_executionsdeserialized only the first page'stradesand returned it, so any window with >1000 fills was silently truncated (reported in longbridge/longbridge-terminal#320).Change
history_executionsnow walks every page via thepagequery parameter (1-based) untilhas_moreis false, returning the complete set. Deduped bytrade_idas a guard; bounded to 1000 pages.Verified against production (
openapi.longbridge.com): on an account with 122 fills,page=1returns all 122 whilepage=2returns empty — confirming the gateway honorspage(a page-ignoring gateway would return the same 122 for page=2). Response shape isdata: { has_more, trades[] }.Public signature unchanged (
GetHistoryExecutionsOptions→Vec<Execution>). The blocking wrapper and all language bindings delegate to this method, so they get complete results for free — no per-binding change.Testing
cargo build+cargo clippyclean. Live-verifiedpagesemantics against production.Refs longbridge/longbridge-terminal#320