Skip to content

fix(api): Type trace-meta transaction.event_id as nullable - #130511

Merged
BYK merged 1 commit into
masterfrom
fix/trace-meta-nullable-transaction-event-id
Nov 9, 2026
Merged

BYK merged 1 commit into
masterfrom
fix/trace-meta-nullable-transaction-event-id

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The trace-meta endpoint groups child spans by transaction.event_id, so spans that belong to no transaction come back as a transactionChildCountMap row with "transaction.event_id": null. The response TypedDict declared that field as a non-null str. Since @sentry/api 1.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 it nullable: 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 with None for not nullable.

This changes only the documented schema. Runtime behavior stays the same. The fix reaches @sentry/api once sentry-api-schema regenerates.

Fixes #130461
Fixes ENG-9010

via @BYK.

--

View Session in Sentry

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]>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 9, 2026 21:09
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 9, 2026 21:09
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 9, 2026
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

ENG-9010

@sentry

sentry Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
- - - - - - ✅ 804 uploaded

Base commit 82fe4c81eaad8858df42e4191603151f4951d750 did not produce snapshots to compare against. Did its snapshot job fail? Try rebasing this branch on a commit with a successful snapshot job.

⚙️ sentry-frontend Snapshot Settings

@BYK
BYK merged commit 126e70b into master Nov 9, 2026
77 of 79 checks passed
@BYK
BYK deleted the fix/trace-meta-nullable-transaction-event-id branch November 9, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trace meta types transaction.event_id as never null

1 participant