Repository navigation
fix(api): Type trace-meta transaction.event_id as nullable - #130511
Merged
Merged
Conversation
Spans that belong to no transaction are grouped under a null transaction.event_id in transactionChildCountMap, but the schema declared it a non-null string, so generated @sentry/api validators rejected these responses. Fixes #130461 Fixes ENG-9010 Co-Authored-By: BYK <[email protected]>
Contributor
Sentry Snapshot Testing
Base commit |
BYK
approved these changes
Nov 9, 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.
The trace-meta endpoint groups child spans by
transaction.event_id, so spans that belong to no transaction come back as atransactionChildCountMaprow with"transaction.event_id": null. The response TypedDict declared that field as a non-nullstr. Since@sentry/api1.52.0, the generated Valibot and Zod validators enforce that type and reject these responses.This change types the field as
str | None, so the generated spec marks itnullable: true. The apidocs test now seeds a span with no transaction and validates the real response against the schema. Without the type change, the test fails withNone for not nullable.This changes only the documented schema. Runtime behavior stays the same. The fix reaches
@sentry/apioncesentry-api-schemaregenerates.Fixes #130461
Fixes ENG-9010
via @BYK.
--
View Session in Sentry