docs(events): note that GET /events silently ignores the order parameter#1611
docs(events): note that GET /events silently ignores the order parameter#1611tsushanth wants to merge 1 commit into
order parameter#1611Conversation
…meter Refs workos#1610. `ListEventOptions.order` was added in workos#1524 to match the API reference, but the live `GET /events` endpoint silently ignores it on every value (`asc`, `desc`, `normal`, omitted) and always returns events oldest-first. That's been verified with raw curl against a sandbox key on 2026-06-11, so it's not an SDK serialization bug. A consumer who upgraded for workos#1524 to seed cursor pagination from the newest event with `order=desc&limit=1` is silently getting the oldest event instead, with no error to root-cause from. Annotate the field's JSDoc with a pointer to the tracking issue so intellisense surfaces the gotcha at the point of confusion, and explain the current ascending behaviour and the cursor-pagination workaround. Leaves the wire format unchanged so callers automatically pick up the server-side fix the moment it ships.
Greptile SummaryAdds a JSDoc warning to
Confidence Score: 4/5Safe to merge — the change is documentation-only; no runtime behaviour, serialization, or type shapes are altered. The diff touches only a JSDoc comment. The one gap worth noting before merging is that the companion SerializedListEventOptions.order field in the same file is left unannotated, so a maintainer working at the serialization layer wouldn’t see the warning without scrolling up. src/events/interfaces/list-events-options.interface.ts — specifically the unannotated SerializedListEventOptions.order field on line 30. Important Files Changed
|
| * parameter and always returns events oldest-first regardless of whether | ||
| * `asc`, `desc`, `normal`, or nothing is sent — see |
There was a problem hiding this comment.
The comment mentions
normal as a value that was tested, but the type union only allows 'asc' | 'desc'. Mentioning normal may confuse readers into thinking it is a valid SDK value. Dropping it keeps the comment consistent with the public API surface.
| * parameter and always returns events oldest-first regardless of whether | |
| * `asc`, `desc`, `normal`, or nothing is sent — see | |
| * parameter and always returns events oldest-first regardless of whether | |
| * `asc`, `desc`, or nothing is sent — see |
Refs #1610.
ListEventOptions.orderwas added in #1524 to match the published API reference, but the liveGET /eventsendpoint silently ignores the parameter — every value (asc,desc,normal, omitted) returns byte-identical, oldest-first pages, verified with raw curl against a sandbox key on 2026-06-11. So this is a server-side bug, not an SDK serialization one. The consequence for SDK consumers is real: anyone who upgraded for #1524 to fetch the newest event withorder=desc&limit=1silently gets the oldest event instead, with no error to root-cause from.This PR adds a JSDoc annotation to the field pointing at #1610, explaining the current ascending behaviour and the cursor-pagination workaround. The wire format is unchanged — callers automatically pick up the server-side fix the moment it ships.
I'd rather not remove the field (that's a breaking change for downstream code that already passes the parameter through), and surfacing it at the type-system level seems like the lowest-friction way to make sure the next person reading intellisense for
listEventsdoesn't waste an afternoon debugging why theirdescrequest comes back ascending. Happy to swap to a@deprecatedtag instead if that's the maintainer preference.