Skip to content

Commit 8c04741

Browse files
committed
Merge branch 'develop' into cursor/update-express-integration-with-new-options-8195
2 parents 79bb6b4 + c4dcfa3 commit 8c04741

File tree

82 files changed

+1318
-245
lines changed

Some content is hidden

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

82 files changed

+1318
-245
lines changed

CHANGELOG.md

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

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

7+
## 9.29.0
8+
9+
### Important Changes
10+
11+
- **feat(browser): Update `web-vitals` to 5.0.2 ([#16492](https://github.com/getsentry/sentry-javascript/pull/16492))**
12+
13+
This release upgrades the `web-vitals` library to version 5.0.2. This upgrade could slightly change the collected web vital values and potentially also influence alerts and performance scores in the Sentry UI.
14+
15+
### Other Changes
16+
17+
- feat(deps): Bump @sentry/rollup-plugin from 3.4.0 to 3.5.0 ([#16524](https://github.com/getsentry/sentry-javascript/pull/16524))
18+
- feat(ember): Stop warning for `onError` usage ([#16547](https://github.com/getsentry/sentry-javascript/pull/16547))
19+
- feat(node): Allow to force activate `vercelAiIntegration` ([#16551](https://github.com/getsentry/sentry-javascript/pull/16551))
20+
- feat(node): Introduce `ignoreLayersType` option to koa integration ([#16553](https://github.com/getsentry/sentry-javascript/pull/16553))
21+
- fix(browser): Ensure `suppressTracing` does not leak when async ([#16545](https://github.com/getsentry/sentry-javascript/pull/16545))
22+
- fix(vue): Ensure root component render span always ends ([#16488](https://github.com/getsentry/sentry-javascript/pull/16488))
23+
724
## 9.28.1
825

926
- feat(deps): Bump @sentry/cli from 2.45.0 to 2.46.0 ([#16516](https://github.com/getsentry/sentry-javascript/pull/16516))

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.28.1",
3+
"version": "9.29.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -42,7 +42,7 @@
4242
"@babel/preset-typescript": "^7.16.7",
4343
"@playwright/test": "~1.50.0",
4444
"@sentry-internal/rrweb": "2.34.0",
45-
"@sentry/browser": "9.28.1",
45+
"@sentry/browser": "9.29.0",
4646
"@supabase/supabase-js": "2.49.3",
4747
"axios": "1.8.2",
4848
"babel-loader": "^8.2.2",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
// Create measures BEFORE SDK initializes
4+
5+
// Create a measure with detail
6+
const measure = performance.measure('restricted-test-measure', {
7+
start: performance.now(),
8+
end: performance.now() + 1,
9+
detail: { test: 'initial-value' },
10+
});
11+
12+
// Simulate Firefox's permission denial by overriding the detail getter
13+
// This mimics the actual Firefox behavior where accessing detail throws
14+
Object.defineProperty(measure, 'detail', {
15+
get() {
16+
throw new DOMException('Permission denied to access object', 'SecurityError');
17+
},
18+
configurable: false,
19+
enumerable: true,
20+
});
21+
22+
window.Sentry = Sentry;
23+
24+
Sentry.init({
25+
dsn: 'https://[email protected]/1337',
26+
integrations: [
27+
Sentry.browserTracingIntegration({
28+
idleTimeout: 9000,
29+
}),
30+
],
31+
tracesSampleRate: 1,
32+
});
33+
34+
// Also create a normal measure to ensure SDK still works
35+
performance.measure('normal-measure', {
36+
start: performance.now(),
37+
end: performance.now() + 50,
38+
detail: 'this-should-work',
39+
});
40+
41+
// Create a measure with complex detail object
42+
performance.measure('complex-detail-measure', {
43+
start: performance.now(),
44+
end: performance.now() + 25,
45+
detail: {
46+
nested: {
47+
array: [1, 2, 3],
48+
object: {
49+
key: 'value',
50+
},
51+
},
52+
metadata: {
53+
type: 'test',
54+
version: '1.0',
55+
tags: ['complex', 'nested', 'object'],
56+
},
57+
},
58+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/core';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
// This is a regression test for https://github.com/getsentry/sentry-javascript/issues/16347
7+
8+
sentryTest(
9+
'should handle permission denial gracefully and still create measure spans',
10+
async ({ getLocalTestUrl, page, browserName }) => {
11+
// Skip test on webkit because we can't validate the detail in the browser
12+
if (shouldSkipTracingTest() || browserName === 'webkit') {
13+
sentryTest.skip();
14+
}
15+
16+
const url = await getLocalTestUrl({ testDir: __dirname });
17+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
18+
19+
// Find all measure spans
20+
const measureSpans = eventData.spans?.filter(({ op }) => op === 'measure');
21+
expect(measureSpans?.length).toBe(3); // All three measures should create spans
22+
23+
// Test 1: Verify the restricted-test-measure span exists but has no detail
24+
const restrictedMeasure = measureSpans?.find(span => span.description === 'restricted-test-measure');
25+
expect(restrictedMeasure).toBeDefined();
26+
expect(restrictedMeasure?.data).toMatchObject({
27+
'sentry.op': 'measure',
28+
'sentry.origin': 'auto.resource.browser.metrics',
29+
});
30+
31+
// Verify no detail attributes were added due to the permission error
32+
const restrictedDataKeys = Object.keys(restrictedMeasure?.data || {});
33+
const restrictedDetailKeys = restrictedDataKeys.filter(key => key.includes('detail'));
34+
expect(restrictedDetailKeys).toHaveLength(0);
35+
36+
// Test 2: Verify the normal measure still captures detail correctly
37+
const normalMeasure = measureSpans?.find(span => span.description === 'normal-measure');
38+
expect(normalMeasure).toBeDefined();
39+
expect(normalMeasure?.data).toMatchObject({
40+
'sentry.browser.measure.detail': 'this-should-work',
41+
'sentry.op': 'measure',
42+
'sentry.origin': 'auto.resource.browser.metrics',
43+
});
44+
45+
// Test 3: Verify the complex detail object is captured correctly
46+
const complexMeasure = measureSpans?.find(span => span.description === 'complex-detail-measure');
47+
expect(complexMeasure).toBeDefined();
48+
expect(complexMeasure?.data).toMatchObject({
49+
'sentry.op': 'measure',
50+
'sentry.origin': 'auto.resource.browser.metrics',
51+
// The entire nested object is stringified as a single value
52+
'sentry.browser.measure.detail.nested': JSON.stringify({
53+
array: [1, 2, 3],
54+
object: {
55+
key: 'value',
56+
},
57+
}),
58+
'sentry.browser.measure.detail.metadata': JSON.stringify({
59+
type: 'test',
60+
version: '1.0',
61+
tags: ['complex', 'nested', 'object'],
62+
}),
63+
});
64+
},
65+
);

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-measure-spans/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ performance.measure('Next.js-before-hydration', {
1010
window.Sentry = Sentry;
1111

1212
Sentry.init({
13-
debug: true,
1413
dsn: 'https://[email protected]/1337',
1514
integrations: [
1615
Sentry.browserTracingIntegration({

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "9.28.1",
3+
"version": "9.29.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

dev-packages/clear-cache-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/clear-cache-gh-action",
33
"description": "An internal Github Action to clear GitHub caches.",
4-
"version": "9.28.1",
4+
"version": "9.29.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "9.28.1",
3+
"version": "9.29.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import { generateText } from 'ai';
2+
import { MockLanguageModelV1 } from 'ai/test';
3+
import { z } from 'zod';
4+
import * as Sentry from '@sentry/nextjs';
5+
6+
export const dynamic = 'force-dynamic';
7+
8+
async function runAITest() {
9+
// First span - telemetry should be enabled automatically but no input/output recorded when sendDefaultPii: true
10+
const result1 = await generateText({
11+
model: new MockLanguageModelV1({
12+
doGenerate: async () => ({
13+
rawCall: { rawPrompt: null, rawSettings: {} },
14+
finishReason: 'stop',
15+
usage: { promptTokens: 10, completionTokens: 20 },
16+
text: 'First span here!',
17+
}),
18+
}),
19+
prompt: 'Where is the first span?',
20+
});
21+
22+
// Second span - explicitly enabled telemetry, should record inputs/outputs
23+
const result2 = await generateText({
24+
experimental_telemetry: { isEnabled: true },
25+
model: new MockLanguageModelV1({
26+
doGenerate: async () => ({
27+
rawCall: { rawPrompt: null, rawSettings: {} },
28+
finishReason: 'stop',
29+
usage: { promptTokens: 10, completionTokens: 20 },
30+
text: 'Second span here!',
31+
}),
32+
}),
33+
prompt: 'Where is the second span?',
34+
});
35+
36+
// Third span - with tool calls and tool results
37+
const result3 = await generateText({
38+
model: new MockLanguageModelV1({
39+
doGenerate: async () => ({
40+
rawCall: { rawPrompt: null, rawSettings: {} },
41+
finishReason: 'tool-calls',
42+
usage: { promptTokens: 15, completionTokens: 25 },
43+
text: 'Tool call completed!',
44+
toolCalls: [
45+
{
46+
toolCallType: 'function',
47+
toolCallId: 'call-1',
48+
toolName: 'getWeather',
49+
args: '{ "location": "San Francisco" }',
50+
},
51+
],
52+
}),
53+
}),
54+
tools: {
55+
getWeather: {
56+
parameters: z.object({ location: z.string() }),
57+
execute: async (args) => {
58+
return `Weather in ${args.location}: Sunny, 72°F`;
59+
},
60+
},
61+
},
62+
prompt: 'What is the weather in San Francisco?',
63+
});
64+
65+
// Fourth span - explicitly disabled telemetry, should not be captured
66+
const result4 = await generateText({
67+
experimental_telemetry: { isEnabled: false },
68+
model: new MockLanguageModelV1({
69+
doGenerate: async () => ({
70+
rawCall: { rawPrompt: null, rawSettings: {} },
71+
finishReason: 'stop',
72+
usage: { promptTokens: 10, completionTokens: 20 },
73+
text: 'Third span here!',
74+
}),
75+
}),
76+
prompt: 'Where is the third span?',
77+
});
78+
79+
return {
80+
result1: result1.text,
81+
result2: result2.text,
82+
result3: result3.text,
83+
result4: result4.text,
84+
};
85+
}
86+
87+
export default async function Page() {
88+
const results = await Sentry.startSpan(
89+
{ op: 'function', name: 'ai-test' },
90+
async () => {
91+
return await runAITest();
92+
}
93+
);
94+
95+
return (
96+
<div>
97+
<h1>AI Test Results</h1>
98+
<pre id="ai-results">{JSON.stringify(results, null, 2)}</pre>
99+
</div>
100+
);
101+
}

dev-packages/e2e-tests/test-applications/nextjs-15/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
"@types/node": "^18.19.1",
1919
"@types/react": "18.0.26",
2020
"@types/react-dom": "18.0.9",
21+
"ai": "^3.0.0",
2122
"next": "15.3.0-canary.33",
2223
"react": "beta",
2324
"react-dom": "beta",
24-
"typescript": "~5.0.0"
25+
"typescript": "~5.0.0",
26+
"zod": "^3.22.4"
2527
},
2628
"devDependencies": {
2729
"@playwright/test": "~1.50.0",

0 commit comments

Comments
 (0)