Skip to content

Commit aecd8c6

Browse files
committed
Merge branch 'develop' into fix/mcp-streamable-http-transport
2 parents bbfd2a4 + a89aa3d commit aecd8c6

File tree

370 files changed

+11715
-5373
lines changed

Some content is hidden

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

370 files changed

+11715
-5373
lines changed

.cursor/BUGBOT.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR Review Guidelines for Cursor Bot
2+
3+
You are reviewing a pull request for the Sentry JavaScript SDK.
4+
Flag any of the following indicators or missing requirements.
5+
If you find anything to flag, mention that you flagged this in the review because it was mentioned in this rules file.
6+
These issues are only relevant for production code.
7+
Do not flag the issues below if they appear in tests.
8+
9+
## Critical Issues to Flag
10+
11+
### Security Vulnerabilities
12+
13+
- Exposed secrets, API keys, tokens or creentials in code or comments
14+
- Unsafe use of `eval()`, `Function()`, or `innerHTML`
15+
- Unsafe regular expressions that could cause ReDoS attacks
16+
17+
### Breaking Changes
18+
19+
- Public API changes without proper deprecation notices
20+
- Removal of publicly exported functions, classes, or types. Internal removals are fine!
21+
- Changes to function signatures in public APIs
22+
23+
## SDK-relevant issues
24+
25+
### Performance Issues
26+
27+
- Multiple loops over the same array (for example, using `.filter`, .`foreach`, chained). Suggest a classic `for` loop as a replacement.
28+
- Memory leaks from event listeners, timers, or closures not being cleaned up or unsubscribing
29+
- Large bundle size increases in browser packages. Sometimes they're unavoidable but flag them anyway.
30+
31+
### Auto instrumentation, SDK integrations, Sentry-specific conventions
32+
33+
- When calling any `startSpan` API (`startInactiveSpan`, `startSpanManual`, etc), always ensure that the following span attributes are set:
34+
- `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` (`'sentry.origin'`) with a proper span origin
35+
- `SEMANTIC_ATTRIBUTE_SENTRY_OP` (`'sentry.op'`) with a proper span op
36+
- When calling `captureException`, always make sure that the `mechanism` is set:
37+
- `handled`: must be set to `true` or `false`
38+
- `type`: must be set to a proper origin (i.e. identify the integration and part in the integration that caught the exception).
39+
- The type should align with the `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` if a span wraps the `captureException` call.
40+
- If there's no direct span that's wrapping the captured exception, apply a proper `type` value, following the same naming
41+
convention as the `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` value.
42+
- When calling `startSpan`, check if error cases are handled. If flag that it might make sense to try/catch and call `captureException`.

.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: 209 additions & 3071 deletions
Large diffs are not rendered by default.

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.0.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.0.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/errors/fetch/test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sentryTest('handles fetch network errors @firefox', async ({ getLocalTestUrl, pa
2424
value: error,
2525
mechanism: {
2626
handled: false,
27-
type: 'onunhandledrejection',
27+
type: 'auto.browser.global_handlers.onunhandledrejection',
2828
},
2929
});
3030
});
@@ -51,7 +51,7 @@ sentryTest('handles fetch network errors on subdomains @firefox', async ({ getLo
5151
value: error,
5252
mechanism: {
5353
handled: false,
54-
type: 'onunhandledrejection',
54+
type: 'auto.browser.global_handlers.onunhandledrejection',
5555
},
5656
});
5757
});
@@ -78,7 +78,7 @@ sentryTest('handles fetch invalid header name errors @firefox', async ({ getLoca
7878
value: error,
7979
mechanism: {
8080
handled: false,
81-
type: 'onunhandledrejection',
81+
type: 'auto.browser.global_handlers.onunhandledrejection',
8282
},
8383
stacktrace: {
8484
frames: expect.any(Array),
@@ -110,7 +110,7 @@ sentryTest('handles fetch invalid header value errors @firefox', async ({ getLoc
110110
value: error,
111111
mechanism: {
112112
handled: false,
113-
type: 'onunhandledrejection',
113+
type: 'auto.browser.global_handlers.onunhandledrejection',
114114
},
115115
stacktrace: {
116116
frames: expect.any(Array),
@@ -152,7 +152,7 @@ sentryTest('handles fetch invalid URL scheme errors @firefox', async ({ getLocal
152152
value: error,
153153
mechanism: {
154154
handled: false,
155-
type: 'onunhandledrejection',
155+
type: 'auto.browser.global_handlers.onunhandledrejection',
156156
},
157157
stacktrace: {
158158
frames: expect.any(Array),
@@ -184,7 +184,7 @@ sentryTest('handles fetch credentials in url errors @firefox', async ({ getLocal
184184
value: error,
185185
mechanism: {
186186
handled: false,
187-
type: 'onunhandledrejection',
187+
type: 'auto.browser.global_handlers.onunhandledrejection',
188188
},
189189
stacktrace: {
190190
frames: expect.any(Array),
@@ -215,7 +215,7 @@ sentryTest('handles fetch invalid mode errors @firefox', async ({ getLocalTestUr
215215
value: error,
216216
mechanism: {
217217
handled: false,
218-
type: 'onunhandledrejection',
218+
type: 'auto.browser.global_handlers.onunhandledrejection',
219219
},
220220
stacktrace: {
221221
frames: expect.any(Array),
@@ -245,7 +245,7 @@ sentryTest('handles fetch invalid request method errors @firefox', async ({ getL
245245
value: error,
246246
mechanism: {
247247
handled: false,
248-
type: 'onunhandledrejection',
248+
type: 'auto.browser.global_handlers.onunhandledrejection',
249249
},
250250
stacktrace: {
251251
frames: expect.any(Array),
@@ -277,7 +277,7 @@ sentryTest(
277277
value: error,
278278
mechanism: {
279279
handled: false,
280-
type: 'onunhandledrejection',
280+
type: 'auto.browser.global_handlers.onunhandledrejection',
281281
},
282282
stacktrace: {
283283
frames: expect.any(Array),

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`,

0 commit comments

Comments
 (0)