Skip to content

fix: Allow nullable transaction.event_id in trace metadata schema - #494

Merged
dcramer merged 1 commit into
mainfrom
fix-MCP-SERVER-EFR
Aug 13, 2025
Merged

dcramer merged 1 commit into
mainfrom
fix-MCP-SERVER-EFR

Conversation

@dcramer

@dcramer dcramer commented Aug 13, 2025

Copy link
Copy Markdown
Member

Fixes MCP-SERVER-EFR

The Sentry API can return null values for transaction.event_id when spans are not directly associated with transaction events. Updated the Zod schema to handle these null values and added test coverage with fixtures.

Fixes MCP-SERVER-EFR

The Sentry API can return null values for transaction.event_id when spans
are not directly associated with transaction events. Updated the Zod schema
to handle these null values and added test coverage with fixtures.
@dcramer

dcramer commented Aug 13, 2025

Copy link
Copy Markdown
Member Author

unrelated package lock fuckup in here but its fine

@dcramer
dcramer merged commit bf449b5 into main Aug 13, 2025
@dcramer
dcramer deleted the fix-MCP-SERVER-EFR branch August 13, 2025 17:53
BYK added a commit that referenced this pull request Nov 9, 2026
…2117)

#2113 already moved main to `@sentry/api` 1.53.0. This PR fixes what
that bump left broken. The branch started as a 1.52.0 bump and merges
main, so it doesn't change any dependencies. 1.53.0 only adds docs for
the 2 AI-conversation operations on top of 1.52.0. Its validators are
identical once descriptions are stripped.

1.52.0 gives types to many response fields that used to be open records.
It adds about 250 patterns and 140 enums, and replaces about 125
`additionalProperties: {}` objects with typed ones. I diffed every
valibot schema the CLI validates responses with against 1.51.0. Two of
them can reject real responses:

- **Trace meta.** `transactionChildCountMap[].transaction.event_id` is
now a required string. Sentry returns null there for spans that belong
to no transaction (#494). With 1.52.0 or later, `getTraceMeta` throws on
those traces, and `replay view` drops their counts. The CLI now accepts
null. The spec is wrong here, see getsentry/sentry#130461.
- **Sentry App components.** `schema` is now the UI element union that
Sentry checks apps against when they're saved. Main still validates
every component against it. One installed app whose stored schema
doesn't match it would fail the whole listing and block linking through
every app. The CLI now leaves `schema` unchecked and still validates the
selected app's link form with `LinkFormSchema`.

The output-schema field extractor now recognizes `strictObject`, which
1.52.0 emits for closed objects. Alert `config` shows as `object` again
in the skill reference instead of `unknown`. Monitor `config` still has
no description, because the generated validators drop the description on
`anyOf` unions (getsentry/sentry-api-schema#139).

I checked the other changes against the Sentry serializers:
- The integration `status` enum and the typed `aspects` match every
provider.
- Timeseries `groupBy.value` only got looser.
- The replay segment, external issue and installation schemas didn't
change.
- Toolkit doesn't use the removed `targetSampleRate`, `samplingMode` and
`invite_link` fields.

Testing: `tsc` and `lint` pass on the merged branch. CLI `test:unit`
passes except for the 5 known file-permission tests (EACCES/EPERM).
Before the merge, the full `pnpm run test`, `measure-tokens` and CLI
`ci:policy` also passed, except for those tests and the codemod test,
which needs glibc 2.35. New tests cover a null trace-meta id, a
non-conforming component from another app, and strict objects in the
field extractor.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A9671a009327aa256e6910769b597562b -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3A9671a009327aa256e6910769b597562b/?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 branch was previously deployed

1 inactive deployment
Actions — adf8dc36 Deployed Aug 13, 2025 by dcramer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant