Skip to content

Conversation

@JPeer264
Copy link
Member

@JPeer264 JPeer264 commented Jan 27, 2026

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

Closes #18987 (added automatically)

Copy link

@cursor cursor bot left a comment

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

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 Cursor Fix in Web

Copy link
Member Author

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
Contributor

size-limit report 📦

Path Size % Change Change
⛔️ @sentry/browser (max: 26 kB) 26.02 kB added added
@sentry/browser - with treeshaking flags 24.53 kB added added
⛔️ @sentry/browser (incl. Tracing) (max: 43 kB) 43.01 kB added added
@sentry/browser (incl. Tracing, Profiling) 47.59 kB added added
@sentry/browser (incl. Tracing, Replay) 81.69 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71.27 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 86.37 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 98.53 kB added added
@sentry/browser (incl. Feedback) 42.73 kB added added
@sentry/browser (incl. sendFeedback) 30.68 kB added added
@sentry/browser (incl. FeedbackAsync) 35.69 kB added added
@sentry/browser (incl. Metrics) 26.96 kB added added
⛔️ @sentry/browser (incl. Logs) (max: 27 kB) 27.1 kB added added
@sentry/browser (incl. Metrics & Logs) 27.75 kB added added
@sentry/react 27.74 kB added added
@sentry/react (incl. Tracing) 45.25 kB added added
@sentry/vue 30.69 kB added added
@sentry/vue (incl. Tracing) 44.84 kB added added
⛔️ @sentry/svelte (max: 26 kB) 26.05 kB added added
CDN Bundle 28.31 kB added added
CDN Bundle (incl. Tracing) 43.55 kB added added
⛔️ CDN Bundle (incl. Tracing, Logs, Metrics) (max: 44 kB) 44.48 kB added added
CDN Bundle (incl. Tracing, Replay) 80.23 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 85.73 kB added added
CDN Bundle - uncompressed 82.79 kB added added
CDN Bundle (incl. Tracing) - uncompressed 128.95 kB added added
⛔️ CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed (max: 130 kB) 131.97 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.49 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.28 kB added added
@sentry/nextjs (client) 47.62 kB added added
@sentry/sveltekit (client) 43.45 kB added added
@sentry/node-core 52.7 kB added added
@sentry/node 165.03 kB added added
@sentry/node - without tracing 96.26 kB added added
@sentry/aws-serverless 111.52 kB added added

Copy link
Member

@Lms24 Lms24 left a comment

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
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
return false
continue;

Copy link
Member Author

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

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.

3 participants