Skip to content

fix(calendar): expose next_date cursor in finance_calendar response#532

Merged
hogan-yuan merged 4 commits into
mainfrom
fix/finance-calendar-pagination
Jun 2, 2026
Merged

fix(calendar): expose next_date cursor in finance_calendar response#532
hogan-yuan merged 4 commits into
mainfrom
fix/finance-calendar-pagination

Conversation

@hogan-yuan
Copy link
Copy Markdown
Member

Summary

  • The /v1/quote/finance_calendar endpoint paginates via a next_date cursor, but all SDK bindings were silently dropping it, making multi-page range queries return incomplete data (e.g. CRM.US, PDD.US, MRVL.US missing for a 2026-05-23→05-30 range)
  • next_date is now returned as-is in CalendarEventsResponse across all language SDKs so callers can follow the cursor themselves

Changes

File Change
rust/src/calendar/types.rs Add next_date to CalendarEventsResponse
rust/src/calendar/context.rs Revert to single request (no internal pagination)
c/src/calendar_context/types.rs Add next_date to C binding owned/FFI types
c/csrc/include/longbridge.h Add next_date to lb_calendar_events_response_t
cpp/include/calendar_context.hpp Add next_date to C++ CalendarEventsResponse struct
cpp/src/calendar_context.cpp Populate next_date from C response in callback
nodejs/index.d.ts Add nextDate: string to CalendarEventsResponse
python/pysrc/longbridge/openapi.pyi Add next_date: str to CalendarEventsResponse
java/.../CalendarEventsResponse.java Add public String nextDate

Related

hogan-yuan and others added 4 commits June 2, 2026 09:50
… results

The /v1/quote/finance_calendar endpoint paginates via a next_date cursor.
Previously only the first page was returned, causing events on later pages
(e.g. CRM.US, PDD.US, MRVL.US for a 2026-05-23→05-30 range) to be silently
dropped.

Add an internal Page deserialization type with next_date and loop in
finance_calendar() until next_date is empty, deduplicating events by ID
across pages. All language bindings (Node.js, Python, Java, C, C++) delegate
to this Rust core and are fixed automatically.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The /v1/quote/finance_calendar endpoint paginates via a next_date cursor.
Previously next_date was silently dropped, making it impossible for callers
to fetch subsequent pages. Now next_date is returned as-is so callers can
follow the cursor themselves.

Changes across all language SDKs:
- Rust: add next_date to CalendarEventsResponse, revert to single request
- C: add next_date to lb_calendar_events_response_t and CCalendarEventsResponseOwned
- C++: add next_date to CalendarEventsResponse struct and populate in callback
- Node.js: add nextDate to CalendarEventsResponse interface
- Python: add next_date to CalendarEventsResponse stub
- Java: add nextDate field to CalendarEventsResponse

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The impl_java_class! macro was missing next_date, causing the Java SDK
build to fail as the field exists in CalendarEventsResponse.java but
was never set from the Rust side.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan merged commit ae02853 into main Jun 2, 2026
56 checks passed
@hogan-yuan hogan-yuan deleted the fix/finance-calendar-pagination branch June 2, 2026 09:21
hogan-yuan added a commit that referenced this pull request Jun 2, 2026
## Summary

Bump version to `4.2.2` and add CHANGELOG entry.

## Changes in 4.2.2

### Fixed

- **All languages:** `CalendarEventsResponse` now exposes `next_date`
cursor — callers can pass it as `start` (with the same `end`) to fetch
the next page of `/v1/quote/finance_calendar` results
- **All languages:** `CalendarEventInfo.symbol` now returns standard
symbol format (e.g. `CRM.US`) instead of raw `counter_id` format (e.g.
`ST/US/CRM`)

## Related

- PR #532
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