feat: update @sentry/api to 0.133.0 and adopt pagination improvements#915
Merged
feat: update @sentry/api to 0.133.0 and adopt pagination improvements#915
Conversation
Update @sentry/api from 0.113.0 to 0.133.0, which includes pagination
wrappers, prevCursor support, and widened query types (cursor and
per_page now declared on paginated endpoints).
Changes:
- Bump @sentry/api to ^0.133.0 in devDependencies
- Add prevCursor to PaginatedResponse type and unwrapPaginatedResult
- Replace manual pagination loops with autoPaginate in listProjects()
and listAllRepositories(), eliminating ~40 lines of cursor management
- Narrow 5 unsafe `as { cursor?: string }` casts to typed alternatives
now that cursor/per_page are in the SDK query types
- Remove unnecessary multi-line result casts in issues, events, teams
- Remove stale comments about per_page not being in the OpenAPI spec
The CLI keeps its own unwrapPaginatedResult (not the SDK's) because
the CLI's error pipeline depends on ApiError/AuthError types that the
SDK's unwrapResult does not preserve.
traces.ts, discover.ts, and dashboards.ts widget queries are left
on raw apiRequestToRegion — they use Zod validation schemas and the
error-type incompatibility makes migration to SDK wrappers non-trivial.
These will be addressed in a follow-up.
Contributor
|
Contributor
Codecov Results 📊✅ 6664 passed | Total: 6664 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 58.33%. Project has 13545 uncovered lines. Files with missing lines (4)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 76.63% 76.59% -0.04%
==========================================
Files 303 303 —
Lines 57821 57849 +28
Branches 0 0 —
==========================================
+ Hits 44308 44304 -4
- Misses 13513 13545 +32
- Partials 0 0 —Generated by Codecov Action |
The refactor to use autoPaginate removed per-callsite warning logs that fired when MAX_PAGINATION_PAGES was reached. Move the warning into autoPaginate itself so all callers benefit from the truncation notice.
BYK
reviewed
May 5, 2026
…X_SAFE_INTEGER Replace Number.MAX_SAFE_INTEGER with MAX_PAGINATION_PAGES * API_MAX_PER_PAGE (50 * 100 = 5000) as the autoPaginate limit in listProjects and listAllRepositories. This makes the row-count cap explicit and aligned with the page-count safety net already inside autoPaginate.
BYK
approved these changes
May 5, 2026
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.
Update
@sentry/apifrom 0.113.0 to 0.133.0 and adopt the new pagination type improvements. This eliminates 5 unsafeas { cursor?: string }casts, replaces 2 manual pagination loops withautoPaginate, and addsprevCursorsupport toPaginatedResponse.Changes
@sentry/api^0.133.0 — includes pagination wrappers (fetchPage_*,paginateAll_*,paginateUpTo_*), widened query types (cursor+per_pagenow typed), andprevCursorin link header parsingPaginatedResponse<T>gainsprevCursor?: string;unwrapPaginatedResultpasses it throughautoPaginateone-liner; casts cleaned upautoPaginate; casts cleaned upas { cursor?: string }casts narrowed/removed; multi-line result casts collapsedWhat's NOT migrated (follow-up)
traces.ts,discover.ts, anddashboards.tswidget queries stay on rawapiRequestToRegion— they use Zod validation schemas and the SDK wrappers' error handling (plainError) is incompatible with the CLI'sApiError/AuthErrorpipeline.Testing
bun test test/lib/api-client.coverage.test.ts— 91/91 passnpx tsc --noEmit— clean (no new errors)