Repository navigation
fix(replays): Reject unknown fields on replay details endpoints - #128518
Merged
gggritso merged 2 commits intoOct 22, 2026
Merged
Conversation
The replay details endpoints passed ?field= values straight to post-processing, which indexes the response dict by each name. Unknown names such as release (instead of releases) raised a KeyError and returned a 500. Validate field against VALID_FIELD_SET and return a 400 instead, matching the index endpoint. Add ota_updates and replay_type to VALID_FIELD_SET because both are real response keys, and add replay_type to the archived row so the existing archived-row coverage test holds. Fixes REPLAY-1032 Co-Authored-By: George Gritsouk <[email protected]>
The hand-maintained tuple drifted from the response TypedDict, which is how ota_updates and replay_type were missing. Build it from the TypedDict keys so a new response field is selectable without a second edit. The resulting set is unchanged. Refs REPLAY-1032 Co-Authored-By: George Gritsouk <[email protected]>
gggritso
reviewed
Oct 22, 2026
gggritso
left a comment
Member
There was a problem hiding this comment.
Makes sense, just one question
Member
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 80d2783. Configure here.
gggritso
marked this pull request as ready for review
October 22, 2026 16:38
wmak
approved these changes
Oct 22, 2026
gggritso
deleted the
georgegritsouk/replay-1032-validate-replay-details-fields
branch
October 22, 2026 16:44
BYK
added a commit
to getsentry/toolkit
that referenced
this pull request
Oct 23, 2026
Upgrades the CLI's `@sentry/api` dependency from `^0.356.0` to `^0.399.0`, the release that includes getsentry/sentry-api-schema#108. That release exports a named type for every enum-valued query parameter, such as `ListOrganizationTraceItemAttributesQueryDataset`, so callers no longer need to derive them with `NonNullable<…["query"]>`. #1559 will switch its trace-item attribute types to these once this lands. The lockfile change only covers `@sentry/api`. `pnpm-workspace.yaml` moves the `minimumReleaseAgeExclude` entry to the new version, because 0.399.0 was published today. Two schema changes between 0.356.0 and 0.399.0 broke existing tests. Both changes match Sentry's current behavior, so the tests were updated rather than the code: - **Sentry App components:** the organization endpoint now returns a required `installationUuid` (getsentry/sentry#127591). The CLI validates this response against the schema, so the `issue-app-links` test fixture now includes the field; without it, all 37 issue-link tests failed. The org endpoint always passes `installation_uuids` to the serializer, so live responses always include the field. Self-hosted servers older than that change will fail this validation. - **Replay fields:** the replay index now accepts every replay response field, including `replay_type`, because the field list comes from `ReplayDetailsResponse` (getsentry/sentry#128518). The two tests that expected `replay_type` to be rejected now check a field that isn't in the schema, `device.model_id`. Verification: typecheck and lint pass. CLI tests: 11,295 passed and 6 failed. The 6 failures are permission tests that also fail on a clean `main` in my sandbox (completions, code-scanner, file-changes, telemetry, upgrade). <!-- junior-request-attribution:start --> via **BYK**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A7fba2603229556152deec3d2 --> -- [View Junior Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A7fba2603229556152deec3d2/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
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.
The org and project replay details endpoints passed
?field=values straight intogenerate_restricted_fieldset, which doesitem[field]for each one. API clients asking for names that aren't response keys (release,device_name,user.geoin production) hit aKeyErrorand got a 500. Instead, let's validate the incoming parameters (since the set or real ones is known) and throw a 400 if they're not valid.Fixes REPLAY-1032
via George Gritsouk.
--
View Junior Session [Sentry]