Repository navigation
fix(browser): Apply urlQueryParams to breadcrumb and element timing URLs
#25289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JPeer264
merged 1 commit into
jp/browser-sensitive-query-params-transactions
from
jp/browser-breadcrumb-element-timing-query-params
Oct 12, 2026
+106
−8
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...ser-integration-tests/suites/integrations/Breadcrumbs/fetch/withSensitiveQuery/subject.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| fetch('http://sentry-test.io/foo?token=sensitive-token-value&page=1').then(() => { | ||
| Sentry.captureException('test error'); | ||
| }); |
25 changes: 25 additions & 0 deletions
25
...rowser-integration-tests/suites/integrations/Breadcrumbs/fetch/withSensitiveQuery/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import type { Event } from '@sentry/core'; | ||
| import { sentryTest } from '../../../../../utils/fixtures'; | ||
| import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers'; | ||
|
|
||
| sentryTest('filters sensitive query params in the fetch breadcrumb URL', async ({ getLocalTestUrl, page }) => { | ||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
|
||
| await page.route('**/foo?*', route => route.fulfill({ status: 200, body: '{}' })); | ||
|
|
||
| const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url); | ||
|
|
||
| expect(eventData.breadcrumbs).toEqual([ | ||
| { | ||
| timestamp: expect.any(Number), | ||
| category: 'fetch', | ||
| type: 'http', | ||
| data: { | ||
| method: 'GET', | ||
| status_code: 200, | ||
| url: 'http://sentry-test.io/foo?token=[Filtered]&page=1', | ||
| }, | ||
| }, | ||
| ]); | ||
| }); |
4 changes: 4 additions & 0 deletions
4
...r-integration-tests/suites/integrations/Breadcrumbs/history/withSensitiveQuery/subject.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| history.pushState({}, '', '/foo?jwt=sensitive-jwt-value&a=1'); | ||
| history.pushState({}, '', '/bar'); | ||
|
|
||
| Sentry.captureException('test exception'); |
29 changes: 29 additions & 0 deletions
29
...wser-integration-tests/suites/integrations/Breadcrumbs/history/withSensitiveQuery/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import type { Event } from '@sentry/browser'; | ||
| import { sentryTest } from '../../../../../utils/fixtures'; | ||
| import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers'; | ||
|
|
||
| sentryTest('filters sensitive query params in navigation breadcrumbs', async ({ getLocalTestUrl, page }) => { | ||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
|
||
| const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url); | ||
|
|
||
| expect(eventData.breadcrumbs).toEqual([ | ||
| { | ||
| category: 'navigation', | ||
| data: { | ||
| from: '/index.html', | ||
| to: '/foo?jwt=[Filtered]&a=1', | ||
| }, | ||
| timestamp: expect.any(Number), | ||
| }, | ||
| { | ||
| category: 'navigation', | ||
| data: { | ||
| from: '/foo?jwt=[Filtered]&a=1', | ||
| to: '/bar', | ||
| }, | ||
| timestamp: expect.any(Number), | ||
| }, | ||
| ]); | ||
| }); |
10 changes: 10 additions & 0 deletions
10
...owser-integration-tests/suites/integrations/Breadcrumbs/xhr/withSensitiveQuery/subject.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const xhr = new XMLHttpRequest(); | ||
|
|
||
| xhr.open('GET', 'http://sentry-test.io/foo?token=sensitive-token-value&page=1'); | ||
| xhr.send(); | ||
|
|
||
| xhr.addEventListener('readystatechange', function () { | ||
| if (xhr.readyState === 4) { | ||
| Sentry.captureException('test error'); | ||
| } | ||
| }); |
25 changes: 25 additions & 0 deletions
25
.../browser-integration-tests/suites/integrations/Breadcrumbs/xhr/withSensitiveQuery/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import type { Event } from '@sentry/core'; | ||
| import { sentryTest } from '../../../../../utils/fixtures'; | ||
| import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers'; | ||
|
|
||
| sentryTest('filters sensitive query params in the XHR breadcrumb URL', async ({ getLocalTestUrl, page }) => { | ||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
|
||
| await page.route('**/foo?*', route => route.fulfill({ status: 200, body: '{}' })); | ||
|
|
||
| const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url); | ||
|
|
||
| expect(eventData.breadcrumbs).toEqual([ | ||
| { | ||
| timestamp: expect.any(Number), | ||
| category: 'xhr', | ||
| type: 'http', | ||
| data: { | ||
| method: 'GET', | ||
| status_code: 200, | ||
| url: 'http://sentry-test.io/foo?token=[Filtered]&page=1', | ||
| }, | ||
| }, | ||
| ]); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterCollectedUrl omits in-scope client
Low Severity
This is more an "is this necessary" check than a functional break:
filterCollectedUrlis called without the in-scopeclient, so it falls back togetClient(). The review guidelines ask to pass the client when one is available sodataCollection.urlQueryParamscomes from the owning client, not the current scope. Flagged because that rule is in the review rules file.Additional Locations (1)
packages/browser-utils/src/performance/elementTiming.ts#L60-L61Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 1aa2891. Configure here.