Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
name: 'sentry.javascript.browser',
packages: expect.anything(),
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
name: 'sentry.javascript.browser',
packages: expect.anything(),
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
name: 'sentry.javascript.browser',
packages: expect.anything(),
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sentryTest(
stacktrace: {
frames: [
{
pre_context: ['<!DOCTYPE html>', '<html>', '<head>', ' <meta charset="utf-8">', ' </head>', ' <body>'],
pre_context: ['<html>', '<head>', ' <meta charset="utf-8">', ' </head>', ' <body>'],
context_line:
' <button id="inline-error-btn" onclick="throw new Error(\'Error with context lines\');">Click me</button>',
post_context: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,18 @@ sentryTest(
{
lineno: 12,
pre_context: [
' <script>',
' function throwTestError() {',
" throw new Error('Error with context lines');",
' }',
' </script>',
' </head>',
' <body>',
],
context_line: ' <button id="inline-error-btn" onclick="throwTestError()">Click me</button>',
post_context: [
expect.stringContaining('<script'), // this line varies in the test based on tarball/cdn bundle (+variants)
' <footer>Some text...</footer>',
'',
'</body>',
'</html>',
],
post_context: ['', '</body>', '</html>'],
},
{
lineno: 7,
pre_context: [
'<!DOCTYPE html>',
'<html>',
'<head>',
' <meta charset="utf-8">',
Expand All @@ -69,8 +60,6 @@ sentryTest(
' </head>',
' <body>',
' <button id="inline-error-btn" onclick="throwTestError()">Click me</button>',
expect.stringContaining('<script'), // this line varies in the test based on tarball/cdn bundle (+variants)
' <footer>Some text...</footer>',
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration(), Sentry.supabaseIntegration({ supabaseClient })],
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
});

// Simulate database operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sentryTest('allows to setup a client manually & capture exceptions', async ({ ge
version: expect.any(String),
packages: [{ name: expect.any(String), version: expect.any(String) }],
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
contexts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sentryTest('should capture correct SDK metadata', async ({ getLocalTestUrl, page
},
],
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest(
'sets sdk.settings.infer_ip to "auto" on errors when dataCollection.userInfo: true',
async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url));
expect(eventData.sdk?.settings?.infer_ip).toBe('auto');
},
);
sentryTest('sets sdk.settings.infer_ip to "auto" on errors by default', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url));
expect(eventData.sdk?.settings?.infer_ip).toBe('auto');
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
tracesSampleRate: 1,
dataCollection: { userInfo: true },
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import {
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest(
'sets user.ip_address to "auto" on transactions when dataCollection.userInfo: true',
async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}
sentryTest('sets user.ip_address to "auto" on transactions by default', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForTransactionRequestOnUrl(page, url);
const transaction = envelopeRequestParser(req);
expect(transaction.sdk?.settings?.infer_ip).toBe('auto');
},
);
const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForTransactionRequestOnUrl(page, url);
const transaction = envelopeRequestParser(req);
expect(transaction.sdk?.settings?.infer_ip).toBe('auto');
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ Sentry.init({
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 0.0,
integrations: [window.Replay],
dataCollection: { userInfo: true },
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';

sentryTest(
'sets sdk.settings.infer_ip to "auto" on replay events when dataCollection.userInfo: true',
'sets sdk.settings.infer_ip to "auto" on replay events by default',
async ({ getLocalTestUrl, page, browserName }) => {
// We only test this against the NPM package and replay bundles
// and only on chromium as most performance entries are only available in chromium
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ window.Sentry = Sentry;
Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
dataCollection: { userInfo: true },
release: '1.0',
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest(
'sets attrs.ip_address user to {{auto}} on sessions when dataCollection.userInfo: true',
async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const session = await getFirstSentryEnvelopeRequest(page, url);
expect((session as any).attrs.ip_address).toBe('{{auto}}');
},
);
sentryTest('sets attrs.ip_address user to {{auto}} on sessions by default', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const session = await getFirstSentryEnvelopeRequest(page, url);
expect((session as any).attrs.ip_address).toBe('{{auto}}');
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ window.Sentry = Sentry;
Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
dataCollection: { userInfo: true },
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sentryTest('should unset user', async ({ getLocalTestUrl, page }) => {

expect(eventData[0].message).toBe('no_user');

// because dataCollection.userInfo: true
// because user info is collected by default
expect(eventData[0].sdk?.settings?.infer_ip).toBe('auto');

expect(eventData[1].message).toBe('user');
Expand All @@ -22,6 +22,6 @@ sentryTest('should unset user', async ({ getLocalTestUrl, page }) => {

expect(eventData[2].message).toBe('unset_user');

// because dataCollection.userInfo: true
// because user info is collected by default
expect(eventData[2].sdk?.settings?.infer_ip).toBe('auto');
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ window.Sentry = Sentry;
Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
dataCollection: { userInfo: true },
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sentryTest('starts a new session on pageload.', async ({ getLocalTestUrl, page }
expect(session).toEqual({
attrs: {
environment: 'production',
ip_address: '{{auto}}',
release: '0.1',
user_agent: expect.any(String),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sentryTest('starts a session on pageload with page lifecycle (default).', async
expect(session).toEqual({
attrs: {
environment: 'production',
ip_address: '{{auto}}',
release: '0.1',
user_agent: expect.any(String),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ sentryTest('updates the session when the user is set after the initial session',
expect(initialSession).toEqual({
attrs: {
environment: 'production',
ip_address: '{{auto}}',
release: '0.1',
user_agent: expect.any(String),
},
Expand Down Expand Up @@ -78,6 +79,7 @@ sentryTest('includes the user id in the subsequent session', async ({ getLocalTe
expect(initialSession).toEqual({
attrs: {
environment: 'production',
ip_address: '{{auto}}',
release: '0.1',
user_agent: expect.any(String),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ test('@callable() methods work correctly with Sentry instrumentAgentWithSentry',
platform: 'javascript',
event_id: expect.stringMatching(/[a-f0-9]{32}/),
environment: expect.any(String),
user: {
ip_address: '127.0.0.1',
},
release: expect.any(String),
sdk: {
integrations: expect.any(Array),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
}),
MyDurableObjectBase,
);
Expand All @@ -39,7 +38,6 @@ export default Sentry.withSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
}),
{
async fetch(request, env) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const MyMCPAgent = Sentry.instrumentDurableObjectWithSentry(
environment: 'qa',
tunnel: `http://localhost:3031/`,
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
debug: true,
transportOptions: {
bufferSize: 1000,
Expand All @@ -70,7 +69,6 @@ export default Sentry.withSentry(
environment: 'qa',
tunnel: `http://localhost:3031/`,
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
debug: true,
transportOptions: {
bufferSize: 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default Sentry.withSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
debug: true,
transportOptions: {
// We are doing a lot of events at once in this test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
traceLifecycle: 'stream',
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand All @@ -98,7 +97,6 @@ export default Sentry.withSentry(
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
traceLifecycle: 'stream',
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand All @@ -98,7 +97,6 @@ export default Sentry.withSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand Down Expand Up @@ -115,7 +114,6 @@ export default Sentry.withSentry(
environment: 'qa', // dynamic sampling bias to keep transactions
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
transportOptions: {
// We are doing a lot of events at once in this test
bufferSize: 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Sentry.init({
tunnel: 'http://localhost:3031/',
traceLifecycle: 'stream',
tracesSampleRate: 1,
dataCollection: { userInfo: true },
});

const port = 3030;
Expand Down
1 change: 0 additions & 1 deletion dev-packages/e2e-tests/test-applications/deno/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Sentry.init({
debug: !!Deno.env.get('DEBUG'),
tunnel: 'http://localhost:3031/',
tracesSampleRate: 1,
dataCollection: { userInfo: true },
});

const port = 3030;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ app.use(
dsn: process.env.E2E_TEST_DSN,
environment: 'qa',
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
tunnel: 'http://localhost:3031/',
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ app.use(
dsn: env.E2E_TEST_DSN,
environment: 'qa',
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
tunnel: 'http://localhost:3031/',
})),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ Sentry.init({
dsn: process.env.E2E_TEST_DSN,
environment: 'qa',
tracesSampleRate: 1.0,
dataCollection: { userInfo: true },
tunnel: 'http://localhost:3031/',
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Sentry.init({
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#dataCollection
dataCollection: { userInfo: true },
tracesSampleRate: 1.0,
tunnel: `http://localhost:3031/`, // proxy server
});
Loading