Skip to content

Commit 064e912

Browse files
authored
Merge branch 'develop' into onur/hydrogen-rr7
2 parents bc24d6c + ac57eb1 commit 064e912

File tree

398 files changed

+16670
-4999
lines changed

Some content is hidden

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

398 files changed

+16670
-4999
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,29 @@ jobs:
745745
directory: dev-packages/node-integration-tests
746746
token: ${{ secrets.CODECOV_TOKEN }}
747747

748+
job_cloudflare_integration_tests:
749+
name: Cloudflare Integration Tests
750+
needs: [job_get_metadata, job_build]
751+
runs-on: ubuntu-24.04
752+
timeout-minutes: 15
753+
steps:
754+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
755+
uses: actions/checkout@v4
756+
with:
757+
ref: ${{ env.HEAD_COMMIT }}
758+
- name: Set up Node
759+
uses: actions/setup-node@v4
760+
with:
761+
node-version-file: 'package.json'
762+
- name: Restore caches
763+
uses: ./.github/actions/restore-cache
764+
with:
765+
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
766+
767+
- name: Run integration tests
768+
working-directory: dev-packages/cloudflare-integration-tests
769+
run: yarn test
770+
748771
job_remix_integration_tests:
749772
name: Remix (Node ${{ matrix.node }}) Tests
750773
needs: [job_get_metadata, job_build]
@@ -1093,6 +1116,7 @@ jobs:
10931116
job_deno_unit_tests,
10941117
job_node_unit_tests,
10951118
job_node_integration_tests,
1119+
job_cloudflare_integration_tests,
10961120
job_browser_playwright_tests,
10971121
job_browser_loader_tests,
10981122
job_remix_integration_tests,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ packages/gatsby/gatsby-node.d.ts
6060

6161
# intellij
6262
*.iml
63+
/**/.wrangler/*

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ module.exports = [
233233
import: createImport('init'),
234234
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
235235
gzip: true,
236-
limit: '146 KB',
236+
limit: '147 KB',
237237
},
238238
{
239239
name: '@sentry/node - without tracing',

CHANGELOG.md

Lines changed: 179 additions & 3071 deletions
Large diffs are not rendered by default.

MIGRATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Sentry.init({
6161
});
6262
```
6363

64+
- (Session Replay) The `_experiments.autoFlushOnFeedback` option was removed and is now default behavior.
65+
6466
## 3. Behaviour Changes
6567

6668
### Removal of First Input Delay (FID) Web Vital Reporting

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": "9.40.0",
3+
"version": "10.1.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": "9.40.0",
46+
"@sentry/browser": "10.1.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),
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
integrations: [Sentry.browserTracingIntegration({ idleTimeout: 3000, childSpanTimeout: 3000 })],
8+
tracesSampleRate: 1,
9+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sentry.diagnoseSdkConnectivity().then(res => console.log('SDK connectivity:', res));

0 commit comments

Comments
 (0)