Skip to content

fix(trade): page history_executions through all has_more results - #591

Merged
hogan-yuan merged 1 commit into
mainfrom
fix-history-executions-pagination
Sep 11, 2026
Merged

hogan-yuan merged 1 commit into
mainfrom
fix-history-executions-pagination

Conversation

@hogan-yuan

@hogan-yuan hogan-yuan commented Sep 11, 2026

Copy link
Copy Markdown
Member

Problem

/v1/trade/execution/history caps each response at 1000 records. history_executions deserialized only the first page's trades and returned it, so any window with >1000 fills was silently truncated (reported in longbridge/longbridge-terminal#320).

Change

history_executions now walks every page via the page query parameter (1-based) until has_more is false, returning the complete set. Deduped by trade_id as a guard; bounded to 1000 pages.

Verified against production (openapi.longbridge.com): on an account with 122 fills, page=1 returns all 122 while page=2 returns empty — confirming the gateway honors page (a page-ignoring gateway would return the same 122 for page=2). Response shape is data: { has_more, trades[] }.

Public signature unchanged (GetHistoryExecutionsOptionsVec<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 clippy clean. Live-verified page semantics against production.

Refs longbridge/longbridge-terminal#320

@hogan-yuan
hogan-yuan force-pushed the fix-history-executions-pagination branch 2 times, most recently from 5c3205b to 492d304 Compare September 11, 2026 05:39
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
hogan-yuan force-pushed the fix-history-executions-pagination branch from 492d304 to eea924d Compare September 11, 2026 06:02
@hogan-yuan
hogan-yuan merged commit 249869e into main Sep 11, 2026
56 checks passed
@hogan-yuan
hogan-yuan deleted the fix-history-executions-pagination branch September 11, 2026 07:41
@hogan-yuan hogan-yuan mentioned this pull request Sep 14, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant