Repository navigation
feat(api): Read Sentry's list headers and keep Link targets - #131242
Merged
Merged
Conversation
Add readSentryResponseHeaders, which reads Link, X-Hits and X-Max-Hits as numbers, and X-Sentry-Direct-Hit as a boolean. Add parseSentryLinks, which parses Link by rel and keeps each target's href and results flag with its cursor. parseSentryLinkHeader shares its parser and still returns only the usable cursors. Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 16, 2026
2 tasks done
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.
Part of #131203.
Sentry list endpoints return more than cursors in their headers, and right now every consumer reads them by hand. This adds two helpers to the root entry.
readSentryResponseHeaders(headers)returns{ link?, hits?, maxHits?, directHit }.X-HitsandX-Max-Hitscome back as numbers and are omitted when missing or not a non-negative integer, instead ofNaN.X-Sentry-Direct-Hit: 1becomesdirectHit: true. The backend sets it when an ID lookup, such as an event ID or short ID search, finds exactly one item.parseSentryLinks(header)parsesLinkbyreland keeps each target'shref, itsresultsflag (true,false, ornullwhen absent) and its cursor. A UI can then tell an empty previous page from a missing one, or follow the server's next-page URL.parseSentryLinkHeadernow shares the parser and returns the same cursors as before. Nothing existing changes.via @BYK.
--
View Session [Sentry]