Skip to content

Commit 640cb90

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into timfish/test/cloudflare-integration-tests
2 parents 55ecbc1 + 5a57f48 commit 640cb90

File tree

304 files changed

+9364
-4259
lines changed

Some content is hidden

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

304 files changed

+9364
-4259
lines changed

.craft.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ targets:
144144
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/
145145

146146
# AWS Lambda Layer target
147-
- name: aws-lambda-layer
148-
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
149-
layerName: SentryNodeServerlessSDKv10
150-
compatibleRuntimes:
151-
- name: node
152-
versions:
153-
- nodejs18.x
154-
- nodejs20.x
155-
- nodejs22.x
156-
license: MIT
147+
# Commented out until we release v10, otherwise we'd override the current v9 layer
148+
# - name: aws-lambda-layer
149+
# includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
150+
# layerName: SentryNodeServerlessSDKv10
151+
# compatibleRuntimes:
152+
# - name: node
153+
# versions:
154+
# - nodejs18.x
155+
# - nodejs20.x
156+
# - nodejs22.x
157+
# license: MIT
157158

158159
# CDN Bundle Target
159160
- name: gcs

.github/workflows/build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ env:
4747
${{ github.workspace }}/packages/*/lib
4848
${{ github.workspace }}/packages/ember/*.d.ts
4949
${{ github.workspace }}/packages/gatsby/*.d.ts
50-
${{ github.workspace }}/packages/utils/cjs
51-
${{ github.workspace }}/packages/utils/esm
5250
5351
BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }}
5452

@@ -973,13 +971,13 @@ jobs:
973971
retention-days: 7
974972

975973
- name: Pre-process E2E Test Dumps
976-
if: always()
974+
if: failure()
977975
run: |
978976
node ./scripts/normalize-e2e-test-dump-transaction-events.js
979977
980978
- name: Upload E2E Test Event Dumps
981979
uses: actions/upload-artifact@v4
982-
if: always()
980+
if: failure()
983981
with:
984982
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
985983
path: ${{ runner.temp }}/test-application/event-dumps
@@ -1085,13 +1083,13 @@ jobs:
10851083
run: pnpm ${{ matrix.assert-command || 'test:assert' }}
10861084

10871085
- name: Pre-process E2E Test Dumps
1088-
if: always()
1086+
if: failure()
10891087
run: |
10901088
node ./scripts/normalize-e2e-test-dump-transaction-events.js
10911089
10921090
- name: Upload E2E Test Event Dumps
10931091
uses: actions/upload-artifact@v4
1094-
if: always()
1092+
if: failure()
10951093
with:
10961094
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
10971095
path: ${{ runner.temp }}/test-application/event-dumps

.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: '144 KB',
236+
limit: '146 KB',
237237
},
238238
{
239239
name: '@sentry/node - without tracing',

CHANGELOG.md

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

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

7+
Work in this release was contributed by @richardjelinek-fastest. Thank you for your contribution!
8+
79
## 9.40.0
810

911
### Important Changes

MIGRATION.md

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

64+
## 3. Behaviour Changes
65+
66+
### Removal of First Input Delay (FID) Web Vital Reporting
67+
68+
Affected SDKs: All SDKs running in browser applications (`@sentry/browser`, `@sentry/react`, `@sentry/nextjs`, etc.)
69+
70+
In v10, the SDK stopped reporting the First Input Delay (FID) web vital.
71+
This was done because FID has been replaced by Interaction to Next Paint (INP) and is therefore no longer relevant for assessing and tracking a website's performance.
72+
For reference, FID has long been deprecated by Google's official `web-vitals` library and was eventually removed in version `5.0.0`.
73+
Sentry now follows Google's lead by also removing it.
74+
75+
The removal entails **no breaking API changes**. However, in rare cases, you might need to adjust some of your Sentry SDK and product setup:
76+
77+
- Remove any logic in `beforeSend` or other filtering/event processing logic that depends on FID or replace it with INP logic.
78+
- 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.
79+
To replace them, adjust your alerts (or dashbaords) to use INP.
80+
6481
## No Version Support Timeline
6582

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

dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
expectedClickBreadcrumb,
55
expectedCLSPerformanceSpan,
66
expectedFCPPerformanceSpan,
7-
expectedFIDPerformanceSpan,
87
expectedFPPerformanceSpan,
98
expectedLCPPerformanceSpan,
109
expectedMemoryPerformanceSpan,
@@ -56,7 +55,6 @@ sentryTest(
5655
expectedNavigationPerformanceSpan,
5756
expectedLCPPerformanceSpan,
5857
expectedCLSPerformanceSpan,
59-
expectedFIDPerformanceSpan,
6058
expectedFPPerformanceSpan,
6159
expectedFCPPerformanceSpan,
6260
expectedMemoryPerformanceSpan, // two memory spans - once per flush

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
expectedClickBreadcrumb,
55
expectedCLSPerformanceSpan,
66
expectedFCPPerformanceSpan,
7-
expectedFIDPerformanceSpan,
87
expectedFPPerformanceSpan,
98
expectedLCPPerformanceSpan,
109
expectedMemoryPerformanceSpan,
@@ -77,7 +76,6 @@ sentryTest(
7776
expectedNavigationPerformanceSpan,
7877
expectedLCPPerformanceSpan,
7978
expectedCLSPerformanceSpan,
80-
expectedFIDPerformanceSpan,
8179
expectedFPPerformanceSpan,
8280
expectedFCPPerformanceSpan,
8381
expectedMemoryPerformanceSpan, // two memory spans - once per flush
@@ -117,7 +115,6 @@ sentryTest(
117115
expectedReloadPerformanceSpan,
118116
expectedLCPPerformanceSpan,
119117
expectedCLSPerformanceSpan,
120-
expectedFIDPerformanceSpan,
121118
expectedFPPerformanceSpan,
122119
expectedFCPPerformanceSpan,
123120
expectedMemoryPerformanceSpan,
@@ -188,7 +185,6 @@ sentryTest(
188185
expectedNavigationPerformanceSpan,
189186
expectedLCPPerformanceSpan,
190187
expectedCLSPerformanceSpan,
191-
expectedFIDPerformanceSpan,
192188
expectedFPPerformanceSpan,
193189
expectedFCPPerformanceSpan,
194190
expectedMemoryPerformanceSpan,
@@ -326,7 +322,6 @@ sentryTest(
326322
expectedNavigationPerformanceSpan,
327323
expectedLCPPerformanceSpan,
328324
expectedCLSPerformanceSpan,
329-
expectedFIDPerformanceSpan,
330325
expectedFPPerformanceSpan,
331326
expectedFCPPerformanceSpan,
332327
expectedMemoryPerformanceSpan,
Lines changed: 105 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect } from '@playwright/test';
2+
import type { replayIntegration as actualReplayIntegration } from '@sentry-internal/replay';
23
import { sentryTest } from '../../../utils/fixtures';
34
import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates';
45
import {
@@ -13,55 +14,122 @@ import {
1314
// Session should expire after 2s - keep in sync with init.js
1415
const SESSION_TIMEOUT = 2000;
1516

16-
sentryTest('handles an expired session', async ({ browserName, forceFlushReplay, getLocalTestUrl, page }) => {
17-
if (shouldSkipReplayTest() || browserName !== 'chromium') {
18-
sentryTest.skip();
19-
}
17+
sentryTest(
18+
'handles an expired session that re-samples to session',
19+
async ({ browserName, forceFlushReplay, getLocalTestUrl, page }) => {
20+
if (shouldSkipReplayTest() || browserName !== 'chromium') {
21+
sentryTest.skip();
22+
}
2023

21-
const reqPromise0 = waitForReplayRequest(page, 0);
22-
const reqPromise1 = waitForReplayRequest(page, 1);
24+
const reqPromise0 = waitForReplayRequest(page, 0);
25+
const reqPromise1 = waitForReplayRequest(page, 1);
2326

24-
const url = await getLocalTestUrl({ testDir: __dirname });
27+
const url = await getLocalTestUrl({ testDir: __dirname });
2528

26-
await page.goto(url);
27-
const req0 = await reqPromise0;
29+
await page.goto(url);
30+
const req0 = await reqPromise0;
2831

29-
const replayEvent0 = getReplayEvent(req0);
30-
expect(replayEvent0).toEqual(getExpectedReplayEvent({}));
32+
const replayEvent0 = getReplayEvent(req0);
33+
expect(replayEvent0).toEqual(getExpectedReplayEvent({}));
3134

32-
const fullSnapshots0 = getFullRecordingSnapshots(req0);
33-
expect(fullSnapshots0.length).toEqual(1);
34-
const stringifiedSnapshot = normalize(fullSnapshots0[0]);
35-
expect(stringifiedSnapshot).toMatchSnapshot('snapshot-0.json');
35+
const fullSnapshots0 = getFullRecordingSnapshots(req0);
36+
expect(fullSnapshots0.length).toEqual(1);
37+
const stringifiedSnapshot = normalize(fullSnapshots0[0]);
38+
expect(stringifiedSnapshot).toMatchSnapshot('snapshot-0.json');
3639

37-
// We wait for another segment 0
38-
const reqPromise2 = waitForReplayRequest(page, 0);
40+
// We wait for another segment 0
41+
const reqPromise2 = waitForReplayRequest(page, 0);
3942

40-
await page.locator('#button1').click();
41-
await forceFlushReplay();
42-
const req1 = await reqPromise1;
43+
await page.locator('#button1').click();
44+
await forceFlushReplay();
45+
const req1 = await reqPromise1;
4346

44-
const replayEvent1 = getReplayEvent(req1);
45-
expect(replayEvent1).toEqual(getExpectedReplayEvent({ segment_id: 1, urls: [] }));
47+
const replayEvent1 = getReplayEvent(req1);
48+
expect(replayEvent1).toEqual(getExpectedReplayEvent({ segment_id: 1, urls: [] }));
4649

47-
const replay = await getReplaySnapshot(page);
48-
const oldSessionId = replay.session?.id;
50+
const replay = await getReplaySnapshot(page);
51+
const oldSessionId = replay.session?.id;
4952

50-
await new Promise(resolve => setTimeout(resolve, SESSION_TIMEOUT));
53+
await new Promise(resolve => setTimeout(resolve, SESSION_TIMEOUT));
5154

52-
await page.locator('#button2').click();
53-
await forceFlushReplay();
54-
const req2 = await reqPromise2;
55+
await page.locator('#button2').click();
56+
await forceFlushReplay();
57+
const req2 = await reqPromise2;
5558

56-
const replay2 = await getReplaySnapshot(page);
59+
const replay2 = await getReplaySnapshot(page);
5760

58-
expect(replay2.session?.id).not.toEqual(oldSessionId);
61+
expect(replay2.session?.id).not.toEqual(oldSessionId);
5962

60-
const replayEvent2 = getReplayEvent(req2);
61-
expect(replayEvent2).toEqual(getExpectedReplayEvent({}));
63+
const replayEvent2 = getReplayEvent(req2);
64+
expect(replayEvent2).toEqual(getExpectedReplayEvent({}));
6265

63-
const fullSnapshots2 = getFullRecordingSnapshots(req2);
64-
expect(fullSnapshots2.length).toEqual(1);
65-
const stringifiedSnapshot2 = normalize(fullSnapshots2[0]);
66-
expect(stringifiedSnapshot2).toMatchSnapshot('snapshot-2.json');
67-
});
66+
const fullSnapshots2 = getFullRecordingSnapshots(req2);
67+
expect(fullSnapshots2.length).toEqual(1);
68+
const stringifiedSnapshot2 = normalize(fullSnapshots2[0]);
69+
expect(stringifiedSnapshot2).toMatchSnapshot('snapshot-2.json');
70+
},
71+
);
72+
73+
sentryTest(
74+
'handles an expired session that re-samples to buffer',
75+
async ({ browserName, forceFlushReplay, getLocalTestUrl, page }) => {
76+
if (shouldSkipReplayTest() || browserName !== 'chromium') {
77+
sentryTest.skip();
78+
}
79+
80+
const reqPromise0 = waitForReplayRequest(page, 0);
81+
const reqPromise1 = waitForReplayRequest(page, 1);
82+
83+
const url = await getLocalTestUrl({ testDir: __dirname });
84+
85+
await page.goto(url);
86+
const req0 = await reqPromise0;
87+
88+
const replayEvent0 = getReplayEvent(req0);
89+
expect(replayEvent0).toEqual(getExpectedReplayEvent({}));
90+
91+
const fullSnapshots0 = getFullRecordingSnapshots(req0);
92+
expect(fullSnapshots0.length).toEqual(1);
93+
const stringifiedSnapshot = normalize(fullSnapshots0[0]);
94+
expect(stringifiedSnapshot).toMatchSnapshot('snapshot-0.json');
95+
96+
await page.locator('#button1').click();
97+
await forceFlushReplay();
98+
const req1 = await reqPromise1;
99+
100+
const replayEvent1 = getReplayEvent(req1);
101+
expect(replayEvent1).toEqual(getExpectedReplayEvent({ segment_id: 1, urls: [] }));
102+
103+
const replay = await getReplaySnapshot(page);
104+
const oldSessionId = replay.session?.id;
105+
106+
await new Promise(resolve => setTimeout(resolve, SESSION_TIMEOUT));
107+
await page.evaluate(() => {
108+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
109+
.Replay;
110+
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
111+
replayIntegration['_replay'].getOptions().sessionSampleRate = 0.0;
112+
});
113+
114+
let wasReplayFlushed = false;
115+
page.on('request', request => {
116+
if (request.url().includes('/api/1337/envelope/')) {
117+
wasReplayFlushed = true;
118+
}
119+
});
120+
await page.locator('#button2').click();
121+
await forceFlushReplay();
122+
123+
// This timeout is not ideal, but not sure of a better way to ensure replay is not flushed
124+
await new Promise(resolve => setTimeout(resolve, SESSION_TIMEOUT));
125+
126+
expect(wasReplayFlushed).toBe(false);
127+
128+
const currentSessionId = await page.evaluate(() => {
129+
// @ts-expect-error - Replay is not typed
130+
return window.Replay._replay.session?.id;
131+
});
132+
133+
expect(currentSessionId).not.toEqual(oldSessionId);
134+
},
135+
);

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fid/template.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)