Repository navigation
Conversation
size-limit report 📦
|
8d885e5 to
9849fe3
Compare
9849fe3 to
e483312
Compare
c0cc99e to
fa408e7
Compare
fa408e7 to
7436507
Compare
7436507 to
b0cd816
Compare
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
85274b7 to
5782a9a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
There are 5 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5782a9a. Configure here.
|
|
||
| const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page); | ||
|
|
||
| expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload'); | ||
| expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled'); | ||
| expect(pageloadTransaction.contexts?.trace?.data?.['sentry.cancellation_reason']).toBe('document.hidden'); | ||
| expect(getSpanOp(pageloadSpan)).toBe('pageload'); | ||
| expect(pageloadSpan.status).toBe('ok'); | ||
| expect(pageloadSpan.attributes['sentry.cancellation_reason']?.value).toBe('document.hidden'); | ||
| }); |
There was a problem hiding this comment.
Bug: The backgroundtab-pageload streaming test incorrectly asserts the pageload span status is 'ok'. It should expect 'cancelled' when the tab is backgrounded.
Severity: LOW
Suggested Fix
In the backgroundtab-pageload test, change the assertion from expect(pageloadSpan.status).toBe('ok') to expect(pageloadSpan.status).toBe('cancelled'). This will align the test with the actual behavior of the registerBackgroundTabDetection function and the corresponding static test.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/backgroundtab-pageload/test.ts#L14-L18
Potential issue: The streaming `backgroundtab-pageload` test incorrectly expects a
pageload span to have a status of `'ok'` after the page is moved to the background. The
`registerBackgroundTabDetection` function is designed to change the span's status from
`'ok'` to `'cancelled'` in this scenario before the span is ended and streamed. As a
result, the test assertion `expect(pageloadSpan.status).toBe('ok')` will fail because
the actual status will be `'cancelled'`. This is confirmed by an equivalent static test
which correctly asserts the status is `'cancelled'`.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
streamed spans map cancelled to ok
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
Lms24
left a comment
There was a problem hiding this comment.
just some optional improvement suggestions and a bug which we should address separately
| }); | ||
|
|
||
| expect(traceContextData![SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]).toBeUndefined(); | ||
| expect(attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]).toEqual({ type: 'string', value: 'new name' }); |
There was a problem hiding this comment.
m: This is a bug. this attribute shouldn't be sent along. I'm fine with merging this PR first and fixing it in a follow-up, so not a blocker for this PR!
on that note, we likely need to remove the attribute in another code path than we already do for transactions, so I'd argue we should keep this test around in both variants, static and streamed.
| const testSpan = eventData.spans?.find(span => span.description === 'pageload-child-span'); | ||
| expect(getSpanOp(pageloadSpan)).toBe('pageload'); | ||
| expect(pageloadSpan.attributes['sentry.idle_span_discarded_spans']).toBeUndefined(); | ||
| expect(spans.length).toBeGreaterThanOrEqual(1); |
There was a problem hiding this comment.
l: should this be 2? (child and pageload)
| expect(spans.length).toBeGreaterThanOrEqual(1); | |
| expect(spans.length).toBeGreaterThanOrEqual(2); |
| discarded_events: [ | ||
| { | ||
| category: 'transaction', | ||
| category: 'span', |
There was a problem hiding this comment.
l: this could be flaky since the navigation span here could include child spans. probably fine to assert on quantity equalOrGreater than 1
| discarded_events: [ | ||
| { | ||
| category: 'transaction', | ||
| category: 'span', |
| await page.waitForTimeout(1000); | ||
| expect(txnsReceived).toEqual(0); | ||
| }); | ||
| expect(spansReceived).toHaveLength(0); |
There was a problem hiding this comment.
l: this check now got a little weaker since we don't send the segments immediately when they finish but we wait for 500ms before flushing them. I think what we could do here is trigger a Sentry.flush() and then assert expect(spansReceived).toHaveLength(0); again.

Exercise browserTracingIntegration with default span streaming, including low-cardinality names and children sent across envelopes. Retain the existing transaction counterparts as explicitly pinned
*-staticsuites to preserve compatibility coverage for navigation, pageloads, linked traces, timing, and sampling.Stacked on #24881 for the shared span collector and dynamic sampling context helpers.
Fixes #24142