Skip to content

Commit cabb4ab

Browse files
s1gr1dchargomeclaude
authored
feat(core)!: Enable data collection by default (#22917)
First merge this PR (is merged): #22913 Enable the `dataCollection` specification defaults when neither `dataCollection` nor the legacy `sendDefaultPii` option is configured. Tests and development test applications now rely on the new defaults instead of redundantly opting into `userInfo` and related data. closes #22707 --------- Co-authored-by: Charly Gomez <charly.gomez1310@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent f1041f9 commit cabb4ab

132 files changed

Lines changed: 178 additions & 498 deletions

File tree

Some content is hidden

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

dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
6767
name: 'sentry.javascript.browser',
6868
packages: expect.anything(),
6969
settings: {
70-
infer_ip: 'never',
70+
infer_ip: 'auto',
7171
},
7272
},
7373
request: {

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6767
name: 'sentry.javascript.browser',
6868
packages: expect.anything(),
6969
settings: {
70-
infer_ip: 'never',
70+
infer_ip: 'auto',
7171
},
7272
},
7373
request: {

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
101101
name: 'sentry.javascript.browser',
102102
packages: expect.anything(),
103103
settings: {
104-
infer_ip: 'never',
104+
infer_ip: 'auto',
105105
},
106106
},
107107
request: {

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6767
name: 'sentry.javascript.browser',
6868
packages: expect.anything(),
6969
settings: {
70-
infer_ip: 'never',
70+
infer_ip: 'auto',
7171
},
7272
},
7373
request: {

dev-packages/browser-integration-tests/suites/integrations/ContextLines/inline/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sentryTest(
3333
stacktrace: {
3434
frames: [
3535
{
36-
pre_context: ['<!DOCTYPE html>', '<html>', '<head>', ' <meta charset="utf-8">', ' </head>', ' <body>'],
36+
pre_context: ['<html>', '<head>', ' <meta charset="utf-8">', ' </head>', ' <body>'],
3737
context_line:
3838
' <button id="inline-error-btn" onclick="throw new Error(\'Error with context lines\');">Click me</button>',
3939
post_context: [

dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ sentryTest(
3535
{
3636
lineno: 12,
3737
pre_context: [
38-
' <script>',
39-
' function throwTestError() {',
4038
" throw new Error('Error with context lines');",
4139
' }',
4240
' </script>',
@@ -55,7 +53,6 @@ sentryTest(
5553
{
5654
lineno: 7,
5755
pre_context: [
58-
'<!DOCTYPE html>',
5956
'<html>',
6057
'<head>',
6158
' <meta charset="utf-8">',
@@ -69,8 +66,6 @@ sentryTest(
6966
' </head>',
7067
' <body>',
7168
' <button id="inline-error-btn" onclick="throwTestError()">Click me</button>',
72-
expect.stringContaining('<script'), // this line varies in the test based on tarball/cdn bundle (+variants)
73-
' <footer>Some text...</footer>',
7469
],
7570
},
7671
],

dev-packages/browser-integration-tests/suites/integrations/supabase/db-operations/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Sentry.init({
1010
dsn: 'https://public@dsn.ingest.sentry.io/1337',
1111
integrations: [Sentry.browserTracingIntegration(), Sentry.supabaseIntegration({ supabaseClient })],
1212
tracesSampleRate: 1.0,
13-
dataCollection: { userInfo: true },
1413
});
1514

1615
// Simulate database operations

dev-packages/browser-integration-tests/suites/manual-client/browser-context/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sentryTest('allows to setup a client manually & capture exceptions', async ({ ge
4242
version: expect.any(String),
4343
packages: [{ name: expect.any(String), version: expect.any(String) }],
4444
settings: {
45-
infer_ip: 'never',
45+
infer_ip: 'auto',
4646
},
4747
},
4848
contexts: {

dev-packages/browser-integration-tests/suites/public-api/captureException/simpleError/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sentryTest('should capture correct SDK metadata', async ({ getLocalTestUrl, page
4040
},
4141
],
4242
settings: {
43-
infer_ip: 'never',
43+
infer_ip: 'auto',
4444
},
4545
});
4646
});

dev-packages/browser-integration-tests/suites/public-api/dataCollection/errors/test.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { expect } from '@playwright/test';
22
import { sentryTest } from '../../../../utils/fixtures';
33
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';
44

5-
sentryTest(
6-
'sets sdk.settings.infer_ip to "auto" on errors when dataCollection.userInfo: true',
7-
async ({ getLocalTestUrl, page }) => {
8-
const url = await getLocalTestUrl({ testDir: __dirname });
9-
const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url));
10-
expect(eventData.sdk?.settings?.infer_ip).toBe('auto');
11-
},
12-
);
5+
sentryTest('sets sdk.settings.infer_ip to "auto" on errors by default', async ({ getLocalTestUrl, page }) => {
6+
const url = await getLocalTestUrl({ testDir: __dirname });
7+
const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url));
8+
expect(eventData.sdk?.settings?.infer_ip).toBe('auto');
9+
});

0 commit comments

Comments
 (0)