fix(calendar): expose finance_calendar pagination parameters - #597
Merged
Merged
Conversation
The finance_calendar method issued a single request with no page-size control, so the server's default page cap (~10 events) made even a one-day query look truncated at 10 results. Expose the endpoint's pagination controls instead of hiding them behind an internal loop: add optional `count`, `offset` and `next` (a new CalendarPageDirection enum) parameters and return the response's `next_date` cursor as-is, so callers can page through the full window themselves. Propagated across all layers: Rust core + blocking, C (cbindgen), C++, Java (JNI + FinanceCalendarOptions), Node.js (napi), Python (PyO3). Reported as longbridge/developers#1265
hogan-yuan
force-pushed
the
fix/finance-calendar-paginate
branch
from
September 23, 2026 01:56
e64f3c4 to
a343f9b
Compare
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.
What
CalendarContext.finance_calendarissued a single request with no page-size control, so the server's default page cap (~10 events) made even a one-day query look truncated at 10 results (reported as longbridge/developers#1265).Rather than hide pagination behind an internal loop, this exposes the endpoint's pagination controls so callers can page through results themselves:
count(max events per page),offset(events to skip), andnext(newCalendarPageDirectionenum:Later/Earlier)next_datecursor as-isTo retrieve a full window, request a larger
count, or re-call with the returnednext_dateasstartuntil it comes back empty.Layers updated
Signature change propagated across every layer:
externfn + cbindgen header regenerated:lb_calendar_page_direction_t)std::optional<...>params + enum)FinanceCalendarOptionsfields +CalendarPageDirectionclass)index.d.ts/index.jsregenerated)openapi.pyi)Verification
cargo clippy --all --all-featuresclean;cargo +nightly fmt --allnpm run build:debugregenerated the Node typingsfinance_calendar(Split)now returns the requested window instead of a hard 10-item capDocs updated in longbridge/developers (separate PR).
Reported as longbridge/developers#1265