Skip to content

Commit ccde98b

Browse files
authored
feat: Ensure getRootSpan() does not rely on transaction (#10979)
Instead, we keep the root span as a non-enumerable property on the span. We use the already existing method for this, so this should work reasonably well. This also means that now `getRootSpan` can always return a `Span`, not `undefined` anymore, which makes types a bit easier there. Also, we now ensure to export this everywhere.
1 parent 99bcc3d commit ccde98b

File tree

47 files changed

+184
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+184
-159
lines changed

dev-packages/browser-integration-tests/suites/manual-client/browser-context/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const client = new BrowserClient({
2929
transport: makeFetchTransport,
3030
stackParser: defaultStackParser,
3131
integrations,
32-
debug: true,
3332
});
3433

3534
const hub = new Hub(client);

dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7+
// We assert on the debug message, so we need to enable debug mode
78
debug: true,
89
});

dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
32

43
import { sentryTest } from '../../../../utils/fixtures';
5-
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
4+
import {
5+
envelopeRequestParser,
6+
shouldSkipTracingTest,
7+
waitForTransactionRequestOnUrl,
8+
} from '../../../../utils/helpers';
69

710
sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath, page }) => {
811
if (shouldSkipTracingTest()) {
912
sentryTest.skip();
1013
}
1114

1215
const url = await getLocalTestPath({ testDir: __dirname });
13-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
16+
const req = await waitForTransactionRequestOnUrl(page, url);
17+
const transaction = envelopeRequestParser(req);
1418

1519
expect(transaction.transaction).toBe('parent_span');
1620
expect(transaction.spans).toBeDefined();
@@ -22,7 +26,8 @@ sentryTest('should report finished spans as children of the root transaction', a
2226
}
2327

2428
const url = await getLocalTestPath({ testDir: __dirname });
25-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
29+
const req = await waitForTransactionRequestOnUrl(page, url);
30+
const transaction = envelopeRequestParser(req);
2631

2732
expect(transaction.spans).toHaveLength(1);
2833

dev-packages/browser-integration-tests/suites/public-api/startSpan/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ Sentry.init({
88
dsn: 'https://[email protected]/1337',
99
tracesSampleRate: 1.0,
1010
normalizeDepth: 10,
11-
debug: true,
1211
});

dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sentry.init({
1212
sampleRate: 0,
1313
replaysSessionSampleRate: 1.0,
1414
replaysOnErrorSampleRate: 0.0,
15-
debug: true,
1615

1716
integrations: [window.Replay, Sentry.replayCanvasIntegration({ enableManualSnapshot: true })],
1817
});

dev-packages/browser-integration-tests/suites/replay/canvas/records/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sentry.init({
1212
sampleRate: 0,
1313
replaysSessionSampleRate: 1.0,
1414
replaysOnErrorSampleRate: 0.0,
15-
debug: true,
1615

1716
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
1817
});

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sentry.init({
1212
sampleRate: 0,
1313
replaysSessionSampleRate: 1.0,
1414
replaysOnErrorSampleRate: 0.0,
15-
debug: true,
1615

1716
integrations: [Sentry.replayCanvasIntegration(), window.Replay],
1817
});

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sentry.init({
1212
sampleRate: 0,
1313
replaysSessionSampleRate: 1.0,
1414
replaysOnErrorSampleRate: 0.0,
15-
debug: true,
1615

1716
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
1817
});

dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sentry.init({
1212
sampleRate: 0,
1313
replaysSessionSampleRate: 1.0,
1414
replaysOnErrorSampleRate: 0.0,
15-
debug: true,
1615

1716
integrations: [window.Replay],
1817
});

dev-packages/browser-integration-tests/suites/sessions/initial-scope/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ Sentry.init({
1212
username: 'user1337',
1313
},
1414
},
15-
debug: true,
1615
});

0 commit comments

Comments
 (0)