You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a476439
Browse filesBrowse the repository at this point in the historyBrowse files
perf(api): sign search cursors and cut windows at the last row's second
Cursors are HMAC-signed with EXPRESS_SESSION_SECRET and carry the current
window's bounds, so the next window is computed directly and the range cap
is gone. Each full page cuts its window at the last row's second, keeping
OFFSET small in dense ranges. Only walks led by an exact timestamp key use
windows; others read one window with the 10,000 offset cap. Cursor walks
force the overflow modes to throw instead of truncating.
Copy file name to clipboardExpand all lines: .changeset/search-cursor-pagination.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,4 @@
3
3
'@hyperdx/common-utils': patch
4
4
---
5
5
6
-
Add cursor pagination to the external API v2 search endpoint. Pass the
7
-
`nextCursor` from a response back as `cursor` to fetch the next page; pages are
8
-
scoped to a time window instead of a growing `OFFSET`, so page cost no longer
9
-
grows with depth. The existing `offset` parameter is unchanged.
10
-
11
-
Keep requesting pages until `nextCursor` is `null` — a short page does not mean
12
-
the results are exhausted.
6
+
Add cursor pagination to the external API v2 search endpoint: send `cursor: "start"`, then pass back each `nextCursor` until it is `null`. Cursors are signed with `EXPRESS_SESSION_SECRET`: replicas need a shared value, and rotating it invalidates outstanding cursors.
Copy file name to clipboardExpand all lines: packages/api/openapi.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4818,7 +4818,7 @@
4818
4818
"type": "string",
4819
4819
"maxLength": 1024,
4820
4820
"example": "start",
4821
-
"description": "Send the literal string \"start\" to begin cursor paging, then pass\nback the nextCursor from each response. When set, offset is\nignored; omit cursor entirely to use offset-based paging.\nCursor paging supports time ranges of up to 366 days. As with\noffset, rows that share a timestamp can be skipped or repeated\nbetween pages unless orderBy breaks the tie.\n\nKeep requesting pages until nextCursor is null. A page that is\nempty or returns fewer rows than maxResults does NOT mean the\nresults are exhausted.\n"
4821
+
"description": "Send the literal string \"start\" to begin cursor paging, then pass\nback the nextCursor from each response. When set, offset is\nignored; omit cursor entirely to use offset-based paging.\nAs with offset, rows that share a timestamp can be skipped or\nrepeated between pages unless orderBy breaks the tie.\n\nKeep requesting pages until nextCursor is null. A page that is\nempty or returns fewer rows than maxResults does NOT mean the\nresults are exhausted.\n"
0 commit comments