Skip to content

feat(test-utils): Add a way to wait for single spans for Span streaming - #18986

Merged
JPeer264 merged 1 commit into
lms/feat-span-streaming-pocfrom
jp/add-test-utils
Jan 28, 2026
Merged

feat(test-utils): Add a way to wait for single spans for Span streaming#18986
JPeer264 merged 1 commit into
lms/feat-span-streaming-pocfrom
jp/add-test-utils

Conversation

@JPeer264

@JPeer264JPeer264 commented Jan 27, 2026

Copy link
Copy Markdown
Member

How it should be used is in the JSDoc. It worked quite well for my Cloudflare tests

Closes#18987 (added automatically)

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

for (const envelopeItem of envelopeItems) {
if (!isSpanV2EnvelopeItem(envelopeItem)) {
return false
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early return skips valid Span V2 items in envelope

Medium Severity

The waitForSpanV2 function returns false immediately when encountering any non-Span V2 envelope item, rather than skipping it and continuing to check other items. If an envelope contains mixed item types (e.g., an event item followed by a Span V2 item), the function will never find valid Span V2 spans because it exits on the first non-matching item. The logic differs from waitForSpansV2, which correctly uses an if (isSpanV2EnvelopeItem) pattern to skip non-Span V2 items.

Fix in CursorFix in Web

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can be mixed

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
⛔️ @sentry/browser (max: 26 kB)26.02 kBaddedadded
@sentry/browser - with treeshaking flags24.53 kBaddedadded
⛔️ @sentry/browser (incl. Tracing) (max: 43 kB)43.01 kBaddedadded
@sentry/browser (incl. Tracing, Profiling)47.59 kBaddedadded
@sentry/browser (incl. Tracing, Replay)81.69 kBaddedadded
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags71.27 kBaddedadded
@sentry/browser (incl. Tracing, Replay with Canvas)86.37 kBaddedadded
@sentry/browser (incl. Tracing, Replay, Feedback)98.53 kBaddedadded
@sentry/browser (incl. Feedback)42.73 kBaddedadded
@sentry/browser (incl. sendFeedback)30.68 kBaddedadded
@sentry/browser (incl. FeedbackAsync)35.69 kBaddedadded
@sentry/browser (incl. Metrics)26.96 kBaddedadded
⛔️ @sentry/browser (incl. Logs) (max: 27 kB)27.1 kBaddedadded
@sentry/browser (incl. Metrics & Logs)27.75 kBaddedadded
@sentry/react27.74 kBaddedadded
@sentry/react (incl. Tracing)45.25 kBaddedadded
@sentry/vue30.69 kBaddedadded
@sentry/vue (incl. Tracing)44.84 kBaddedadded
⛔️ @sentry/svelte (max: 26 kB)26.05 kBaddedadded
CDN Bundle28.31 kBaddedadded
CDN Bundle (incl. Tracing)43.55 kBaddedadded
⛔️ CDN Bundle (incl. Tracing, Logs, Metrics) (max: 44 kB)44.48 kBaddedadded
CDN Bundle (incl. Tracing, Replay)80.23 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback)85.73 kBaddedadded
CDN Bundle - uncompressed82.79 kBaddedadded
CDN Bundle (incl. Tracing) - uncompressed128.95 kBaddedadded
⛔️ CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed (max: 130 kB)131.97 kBaddedadded
CDN Bundle (incl. Tracing, Replay) - uncompressed245.49 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed258.28 kBaddedadded
@sentry/nextjs (client)47.62 kBaddedadded
@sentry/sveltekit (client)43.45 kBaddedadded
@sentry/node-core52.7 kBaddedadded
@sentry/node165.03 kBaddedadded
@sentry/node - without tracing96.26 kBaddedadded
@sentry/aws-serverless111.52 kBaddedadded

@Lms24Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


for (const envelopeItem of envelopeItems) {
if (!isSpanV2EnvelopeItem(envelopeItem)) {
return false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we continue here?

Suggested change
returnfalse
continue;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be this comment: #18986 (comment)

Not sure if it is possible to mix envelope items

@JPeer264

Copy link
Copy Markdown
MemberAuthor

I'll merge. I think when having more tests these functions might change a little (but maybe they stay as is). I'm happy to do follow ups ones there are issues with this

@JPeer264
JPeer264 merged commit f528c45 into lms/feat-span-streaming-pocJan 28, 2026
160 of 171 checks passed
@JPeer264
JPeer264 deleted the jp/add-test-utils branch January 28, 2026 10:24
Lms24 pushed a commit that referenced this pull request Jan 30, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Jan 30, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Feb 11, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Feb 13, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Apr 8, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Apr 9, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Lms24 pushed a commit that referenced this pull request Apr 10, 2026
…ng (#18986)
How it should be used is in the JSDoc. It worked quite well for my
Cloudflare tests
Closes#18987 (added automatically)
Sign up for freeto 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.

2 participants

@JPeer264@Lms24