Repository navigation
feat(api): Page the conversation list with a signed cursor - #2232
Draft
sentry-junior[bot] wants to merge 3 commits into
Draft
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
GET /api/conversations returns at most 50 root conversations and had no way to read more. Add an optional cursor query param and an optional nextCursor response field. Without cursor the request behaves as before. The cursor holds the lastActivityAt and conversationId of the last row, which match the existing list order, and is HMAC-signed like the event cursor. An invalid cursor returns 400. Refs #2231 Co-Authored-By: Johannes Daxboeck <114897+dingsdax@users.noreply.github.com>
Co-Authored-By: Johannes Daxboeck <114897+dingsdax@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dingsdax
marked this pull request as draft
October 26, 2026 18:51
The cursor fields pushed schema/conversation.ts past the 1,000-line limit. Conversation stats are a separate resource (/api/conversations/stats), so move their schemas and types to schema/conversation-stats.ts. The public schema exports do not change.
This branch was successfully deployed
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.
GET /api/conversationsreturns at most 50 root conversations, and a client cannot read more. This is PR 1 of #2231.cursorquery param. Without it, the request behaves as before.nextCursorresponse field. It is set only when more rows remain. Existing clients ignore it.lastActivityAtandconversationIdof the last row. This is the same order the list already uses (lastActivityAt DESC, conversationId ASC). It is HMAC-signed like the event cursor, with its own context string. An invalid cursor returns 400.limit + 1rows to learn whether another page exists.Notes for review:
cursorwithq. Search uses the same order, so the cursor works withqandcodeRepositoryId. We decided not to add the restriction.lastActivityAtonly moves forward (greatest(...)on upsert). A conversation with new activity during paging moves above the cursor, so later pages skip it. Pages do not return duplicates.lastActivityAtin milliseconds. All writers set it from JSDatevalues, so the stored value matches exactly.Tests: the linked-user test in
tests/integration/api/conversations/list.test.tsnow follows cursors withlimit: 1across a tie inlastActivityAt. The route test checks the 400 for a bad cursor. I checked that the tie case fails when theconversationIdcomparison is reversed.via @dingsdax.
--
View Junior Session [Sentry]