Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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 @@ -101,7 +101,7 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
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 @@ -29,14 +29,12 @@

const exception = eventData.exception?.values?.[0];

expect(exception).toMatchObject({

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_logs_metrics Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_min Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_replay Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_replay_logs_metrics Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_logs_metrics Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_replay_feedback Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_replay_logs_metrics Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_replay_feedback_logs_metrics Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_replay_feedback_logs_metrics_min Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23

Check failure on line 32 in dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts

View workflow job for this annotation

GitHub Actions / Playwright bundle_tracing_replay Tests

[chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags

1) [chromium] › suites/integrations/ContextLines/scriptTag/test.ts:5:11 › should add source context lines around stack frames from errors in Html script tags Error: expect(received).toMatchObject(expected) - Expected - 1 + Received + 1 @@ -3,11 +3,11 @@ "frames": Array [ Object { "context_line": " <button id=\"inline-error-btn\" onclick=\"throwTestError()\">Click me</button>", "lineno": 12, "post_context": Array [ - " <script defer=\"\" src=\"init.bundle.js\"></script>", + " <script src=\"cdn.bundle.js\"></script><script src=\"contextlines.bundle.js\"></script><script defer=\"\" src=\"init.bundle.js\"></script>", " <footer>Some text...</footer>", "", "</body>", "</html>", ], 30 | const exception = eventData.exception?.values?.[0]; 31 | > 32 | expect(exception).toMatchObject({ | ^ 33 | stacktrace: { 34 | frames: [ 35 | { at /home/runner/work/sentry-javascript/sentry-javascript/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts:32:23
stacktrace: {
frames: [
{
lineno: 12,
pre_context: [
' <script>',
' function throwTestError() {',
" throw new Error('Error with context lines');",
' }',
' </script>',
Expand All @@ -45,7 +43,7 @@
],
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)
' <script defer="" src="init.bundle.js"></script>',
' <footer>Some text...</footer>',
'',
'</body>',
Expand All @@ -55,7 +53,6 @@
{
lineno: 7,
pre_context: [
'<!DOCTYPE html>',
'<html>',
'<head>',
' <meta charset="utf-8">',
Expand All @@ -69,8 +66,6 @@
' </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 @@ -24,7 +24,7 @@ sentryTest('should capture console object calls', async ({ getLocalTestUrl, page
},
{
version: 2,
ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' },
ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' },
items: [
{
timestamp: expect.any(Number),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
},
{
version: 2,
ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' },
ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' },
items: [
{
timestamp: expect.any(Number),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sentryTest('should capture all logging methods', async ({ getLocalTestUrl, page
},
{
version: 2,
ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' },
ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' },
items: [
{
timestamp: expect.any(Number),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('should capture all metric types', async ({ getLocalTestUrl, page })
},
{
version: 2,
ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' },
ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' },
items: [
{
timestamp: expect.any(Number),
Expand Down
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 @@ -63,7 +63,7 @@ sentryTest(
{ content_type: 'application/vnd.sentry.items.span.v2+json', item_count: 4, type: 'span' },
{
version: 2,
ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' },
ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' },
items: expect.any(Array),
},
],
Expand Down
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 @@ -56,7 +56,7 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT
version: SDK_VERSION,
name: 'sentry.javascript.browser',
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down Expand Up @@ -105,7 +105,7 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT
version: SDK_VERSION,
name: 'sentry.javascript.browser',
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTe
version: SDK_VERSION,
name: 'sentry.javascript.browser',
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down Expand Up @@ -105,7 +105,7 @@ sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTe
version: SDK_VERSION,
name: 'sentry.javascript.browser',
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down
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 @@ -40,7 +40,7 @@ const DEFAULT_REPLAY_EVENT = {
version: SDK_VERSION,
name: 'sentry.javascript.browser',
settings: {
infer_ip: 'never',
infer_ip: 'auto',
},
},
request: {
Expand Down
1 change: 1 addition & 0 deletions dev-packages/cloudflare-integration-tests/expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function expectedEvent(event: Event, { sdk }: { sdk: 'cloudflare' | 'hono
environment: 'production',
platform: 'javascript',
sdk: getSdk(sdk),
user: { ip_address: '127.0.0.1' },
...event,
contexts: defaultContexts(event.contexts),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ it('sends a streamed span envelope with correct spans for a manually started spa
},
'http.request.header.cf_connecting_ip': {
type: 'string',
value: '[Filtered]',
value: '127.0.0.1',
},
'user.ip_address': {
type: 'string',
value: '127.0.0.1',
},
'http.request.header.host': {
type: '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
Loading
Loading