Skip to content

Commit 8a47b41

Browse files
authored
Merge branch 'develop' into cg-use-compiler-hook-for-sourcemaps
2 parents 5de3eb7 + a89aa3d commit 8a47b41

File tree

264 files changed

+6151
-1777
lines changed

Some content is hidden

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

264 files changed

+6151
-1777
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,12 @@ jobs:
910910
- name: Set up Bun
911911
if: matrix.test-application == 'node-exports-test-app'
912912
uses: oven-sh/setup-bun@v2
913+
- name: Set up AWS SAM
914+
if: matrix.test-application == 'aws-serverless'
915+
uses: aws-actions/setup-sam@v2
916+
with:
917+
use-installer: true
918+
token: ${{ secrets.GITHUB_TOKEN }}
913919
- name: Restore caches
914920
uses: ./.github/actions/restore-cache
915921
with:

CHANGELOG.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,63 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 10.4.0
8+
9+
### Important Changes
10+
11+
- **fix(browser): Ensure IP address is only inferred by Relay if `sendDefaultPii` is `true`**
12+
13+
This release includes a fix for a [behaviour change](https://docs.sentry.io/platforms/javascript/migration/v8-to-v9/#behavior-changes)
14+
that was originally introduced with v9 of the SDK: User IP Addresses should only be added to Sentry events automatically,
15+
if `sendDefaultPii` was set to `true`.
16+
17+
However, the change in v9 required further internal adjustment, which should have been included in v10 of the SDK.
18+
Unfortunately, the change did not make it into the initial v10 version but is now applied with `10.4.0`.
19+
There is _no API_ breakage involved and hence it is safe to update.
20+
However, after updating the SDK, events (errors, traces, replays, etc.) sent from the browser, will only include
21+
user IP addresses, if you set `sendDefaultPii: true` in your `Sentry.init` options.
22+
23+
We apologize for any inconvenience caused!
24+
25+
- **feat(node): Add `ignoreStaticAssets` ([#17370](https://github.com/getsentry/sentry-javascript/pull/17370))**
26+
27+
This release adds a new option to `httpIntegration` to ignore requests for static assets (e.g. `favicon.xml` or `robots.txt`). The option defaults to `true`, meaning that going forward, such requests will not be traced by default. You can still enable tracing for these requests by setting the option to `false`:
28+
29+
```js
30+
Sentry.init({
31+
integrations: [
32+
Sentry.httpIntegration({
33+
// defaults to true, set to false to enable traces for static assets
34+
ignoreStaticAssets: false,
35+
}),
36+
],
37+
});
38+
```
39+
40+
### Other Changes
41+
42+
- fix(nuxt): Do not drop parametrized routes ([#17357](https://github.com/getsentry/sentry-javascript/pull/17357))
43+
44+
<details>
45+
<summary> <strong>Internal Changes</strong> </summary>
46+
47+
- ref(node): Split up incoming & outgoing http handling ([#17358](https://github.com/getsentry/sentry-javascript/pull/17358))
48+
- test(node): Enable additionalDependencies in integration runner ([#17361](https://github.com/getsentry/sentry-javascript/pull/17361))
49+
50+
</details>
51+
52+
## 10.3.0
53+
54+
- feat(core): MCP Server - Capture prompt results from prompt function calls (#17284)
55+
- feat(bun): Export `skipOpenTelemetrySetup` option ([#17349](https://github.com/getsentry/sentry-javascript/pull/17349))
56+
- feat(sveltekit): Streamline build logs ([#17306](https://github.com/getsentry/sentry-javascript/pull/17306))
57+
- fix(browser): Handle data urls in errors caught by `globalHandlersIntegration` ([#17216](https://github.com/getsentry/sentry-javascript/pull/17216))
58+
- fix(browser): Improve navigation vs. redirect detection ([#17275](https://github.com/getsentry/sentry-javascript/pull/17275))
59+
- fix(react-router): Ensure source map upload fails silently if Sentry CLI fails ([#17081](https://github.com/getsentry/sentry-javascript/pull/17081))
60+
- fix(react): Add support for React Router sub-routes from `handle` ([#17277](https://github.com/getsentry/sentry-javascript/pull/17277))
61+
62+
## 10.2.0
63+
764
### Important Changes
865

966
- **feat(core): Add `ignoreSpans` option ([#17078](https://github.com/getsentry/sentry-javascript/pull/17078))**
@@ -25,6 +82,44 @@ Sentry.init({
2582

2683
Spans matching the filter criteria will not be recorded. Potential child spans of filtered spans will be re-parented, if possible.
2784

85+
- **feat(cloudflare,vercel-edge): Add support for OpenAI instrumentation ([#17338](https://github.com/getsentry/sentry-javascript/pull/17338))**
86+
87+
Adds support for OpenAI manual instrumentation in `@sentry/cloudflare` and `@sentry/vercel-edge`.
88+
89+
To instrument the OpenAI client, wrap it with `Sentry.instrumentOpenAiClient` and set recording settings.
90+
91+
```js
92+
import * as Sentry from '@sentry/cloudflare';
93+
import OpenAI from 'openai';
94+
95+
const openai = new OpenAI();
96+
const client = Sentry.instrumentOpenAiClient(openai, { recordInputs: true, recordOutputs: true });
97+
98+
// use the wrapped client
99+
```
100+
101+
- **ref(aws): Remove manual span creation ([#17310](https://github.com/getsentry/sentry-javascript/pull/17310))**
102+
103+
The `startTrace` option is deprecated and will be removed in a future major version. If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`. instead. As of today, the flag does not affect traces anymore.
104+
105+
### Other Changes
106+
107+
- feat(astro): Streamline build logs ([#17301](https://github.com/getsentry/sentry-javascript/pull/17301))
108+
- feat(browser): Handles data URIs in chrome stack frames ([#17292](https://github.com/getsentry/sentry-javascript/pull/17292))
109+
- feat(core): Accumulate tokens for `gen_ai.invoke_agent` spans from child LLM calls ([#17281](https://github.com/getsentry/sentry-javascript/pull/17281))
110+
- feat(deps): Bump @prisma/instrumentation from 6.12.0 to 6.13.0 ([#17315](https://github.com/getsentry/sentry-javascript/pull/17315))
111+
- feat(deps): Bump @sentry/cli from 2.50.0 to 2.50.2 ([#17316](https://github.com/getsentry/sentry-javascript/pull/17316))
112+
- feat(deps): Bump @sentry/rollup-plugin from 4.0.0 to 4.0.2 ([#17317](https://github.com/getsentry/sentry-javascript/pull/17317))
113+
- feat(deps): Bump @sentry/webpack-plugin from 4.0.0 to 4.0.2 ([#17314](https://github.com/getsentry/sentry-javascript/pull/17314))
114+
- feat(nuxt): Do not inject trace meta-tags on cached HTML pages ([#17305](https://github.com/getsentry/sentry-javascript/pull/17305))
115+
- feat(nuxt): Streamline build logs ([#17308](https://github.com/getsentry/sentry-javascript/pull/17308))
116+
- feat(react-router): Add support for Hydrogen with RR7 ([#17145](https://github.com/getsentry/sentry-javascript/pull/17145))
117+
- feat(react-router): Streamline build logs ([#17303](https://github.com/getsentry/sentry-javascript/pull/17303))
118+
- feat(solidstart): Streamline build logs ([#17304](https://github.com/getsentry/sentry-javascript/pull/17304))
119+
- fix(nestjs): Add missing `sentry.origin` span attribute to `SentryTraced` decorator ([#17318](https://github.com/getsentry/sentry-javascript/pull/17318))
120+
- fix(node): Assign default export of `openai` to the instrumented fn ([#17320](https://github.com/getsentry/sentry-javascript/pull/17320))
121+
- fix(replay): Call `sendBufferedReplayOrFlush` when opening/sending feedback ([#17236](https://github.com/getsentry/sentry-javascript/pull/17236))
122+
28123
## 10.1.0
29124

30125
- feat(nuxt): Align build-time options to follow bundler plugins structure ([#17255](https://github.com/getsentry/sentry-javascript/pull/17255))

MIGRATION.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ The removal entails **no breaking API changes**. However, in rare cases, you mig
8080
- If you set up Sentry Alerts that depend on FID, be aware that these could trigger once you upgrade the SDK, due to a lack of new values.
8181
To replace them, adjust your alerts (or dashbaords) to use INP.
8282

83+
### Update: User IP Address collection gated by `sendDefaultPii`
84+
85+
Version `10.4.0` introduced a change that should have ideally been introduced with `10.0.0` of the SDK.
86+
Originally destined for [version `9.0.0`](https://docs.sentry.io/platforms/javascript/migration/v8-to-v9/#behavior-changes), but having not the desired effect until v10,
87+
SDKs will now control IP address inference of user IP addresses depending on the value of the top level `sendDefaultPii` init option.
88+
89+
- If `sendDefaultPii` is `true`, Sentry will infer the IP address of users' devices to events (errors, traces, replays, etc) in all browser-based SDKs.
90+
- If `sendDefaultPii` is `false` or not set, Sentry will not infer or collect IP address data.
91+
92+
Given that this was already the advertised behaviour since v9, we classify the change [as a fix](https://github.com/getsentry/sentry-javascript/pull/17364),
93+
though we recognize the potential impact of it. We apologize for any inconvenience caused.
94+
8395
## No Version Support Timeline
8496

8597
Version support timelines are stressful for everybody using the SDK, so we won't be defining one.

dev-packages/browser-integration-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "10.1.0",
3+
"version": "10.4.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -43,7 +43,7 @@
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "~1.53.2",
4545
"@sentry-internal/rrweb": "2.34.0",
46-
"@sentry/browser": "10.1.0",
46+
"@sentry/browser": "10.4.0",
4747
"@supabase/supabase-js": "2.49.3",
4848
"axios": "1.8.2",
4949
"babel-loader": "^8.2.2",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
6161
version: expect.any(String),
6262
name: 'sentry.javascript.browser',
6363
packages: expect.anything(),
64+
settings: {
65+
infer_ip: 'never',
66+
},
6467
},
6568
request: {
6669
url: `${TEST_HOST}/index.html`,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6161
version: expect.any(String),
6262
name: 'sentry.javascript.browser',
6363
packages: expect.anything(),
64+
settings: {
65+
infer_ip: 'never',
66+
},
6467
},
6568
request: {
6669
url: `${TEST_HOST}/index.html`,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
9595
version: expect.any(String),
9696
name: 'sentry.javascript.browser',
9797
packages: expect.anything(),
98+
settings: {
99+
infer_ip: 'never',
100+
},
98101
},
99102
request: {
100103
url: `${TEST_HOST}/index.html`,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
6161
version: expect.any(String),
6262
name: 'sentry.javascript.browser',
6363
packages: expect.anything(),
64+
settings: {
65+
infer_ip: 'never',
66+
},
6467
},
6568
request: {
6669
url: `${TEST_HOST}/index.html`,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const workerCode = `
2+
self.addEventListener('message', (event) => {
3+
if (event.data.type === 'error') {
4+
throw new Error('Error thrown in worker');
5+
}
6+
});
7+
`;
8+
9+
const worker = new Worker(`data:text/javascript;base64,${btoa(workerCode)}`);
10+
11+
worker.postMessage({ type: 'error' });
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { expect } from '@playwright/test';
2+
import { sentryTest } from '../../../../utils/fixtures';
3+
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
4+
5+
/**
6+
* Tests a special case where the `globalHandlersIntegration` itself creates a stack frame instead of using
7+
* stack parsers. This is necessary because we don't always get an `error` object passed to `window.onerror`.
8+
* @see `globalhandlers.ts#_enhanceEventWithInitialFrame`
9+
*/
10+
sentryTest('detects and handles data urls on first stack frame', async ({ getLocalTestUrl, page }) => {
11+
const url = await getLocalTestUrl({ testDir: __dirname });
12+
13+
const errorEventPromise = waitForErrorRequest(page, e => {
14+
return !!e.exception?.values;
15+
});
16+
17+
await page.goto(url);
18+
19+
const errorEvent = envelopeRequestParser(await errorEventPromise);
20+
21+
expect(errorEvent?.exception?.values?.[0]).toEqual({
22+
mechanism: {
23+
handled: false,
24+
synthetic: true,
25+
type: 'auto.browser.global_handlers.onerror',
26+
},
27+
stacktrace: {
28+
frames: [
29+
{
30+
colno: expect.any(Number), // webkit reports different colno than chromium
31+
filename: '<data:text/javascript,base64>',
32+
function: '?',
33+
in_app: true,
34+
lineno: 4,
35+
},
36+
],
37+
},
38+
type: 'Error',
39+
value: expect.stringMatching(/(Uncaught )?Error: Error thrown in worker/), // webikt throws without "Uncaught "
40+
});
41+
});

0 commit comments

Comments
 (0)