Skip to content

Commit 75e43af

Browse files
authored
Merge branch 'develop' into fn/nextjs-rewrite-frames
2 parents d113796 + b6e84dc commit 75e43af

File tree

25 files changed

+143
-376
lines changed

25 files changed

+143
-376
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,9 @@ jobs:
865865
'node-express-app',
866866
'create-react-app',
867867
'create-next-app',
868-
'create-remix-app',
869-
'create-remix-app-v2',
868+
# disabling remix e2e tests because of flakes
869+
# 'create-remix-app',
870+
# 'create-remix-app-v2',
870871
'debug-id-sourcemaps',
871872
'nextjs-app-dir',
872873
'nextjs-14',

.size-limit.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ module.exports = [
5454
gzip: true,
5555
limit: '50 KB',
5656
},
57+
{
58+
name: '@sentry/browser (incl. sendFeedback) - Webpack (gzipped)',
59+
path: 'packages/browser/build/npm/esm/index.js',
60+
import: '{ init, sendFeedback }',
61+
gzip: true,
62+
limit: '50 KB',
63+
},
5764
{
5865
name: '@sentry/browser - Webpack (gzipped)',
5966
path: 'packages/browser/build/npm/esm/index.js',
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
beforeSend(event) {
8+
Sentry.captureUserFeedback({
9+
event_id: event.event_id,
10+
name: 'John Doe',
11+
12+
comments: 'This feedback should be attached associated with the captured error',
13+
});
14+
return event;
15+
},
16+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sentry.captureException(new Error('Error with Feedback'));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event, UserFeedback } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
6+
7+
sentryTest('capture user feedback when captureException is called', async ({ getLocalTestPath, page }) => {
8+
const url = await getLocalTestPath({ testDir: __dirname });
9+
10+
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | UserFeedback)[];
11+
12+
expect(data).toHaveLength(2);
13+
14+
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
15+
const feedback = ('exception' in data[0] ? data[1] : data[0]) as UserFeedback;
16+
17+
expect(feedback).toEqual({
18+
comments: 'This feedback should be attached associated with the captured error',
19+
20+
event_id: errorEvent.event_id,
21+
name: 'John Doe',
22+
});
23+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
beforeSend(event) {
8+
Sentry.captureUserFeedback({
9+
event_id: event.event_id,
10+
name: 'John Doe',
11+
12+
comments: 'This feedback should be attached associated with the captured message',
13+
});
14+
return event;
15+
},
16+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sentry.captureMessage('Message with Feedback');
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event, UserFeedback } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
6+
7+
sentryTest('capture user feedback when captureMessage is called', async ({ getLocalTestPath, page }) => {
8+
const url = await getLocalTestPath({ testDir: __dirname });
9+
10+
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | UserFeedback)[];
11+
12+
expect(data).toHaveLength(2);
13+
14+
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
15+
const feedback = ('exception' in data[0] ? data[1] : data[0]) as UserFeedback;
16+
17+
expect(feedback).toEqual({
18+
comments: 'This feedback should be attached associated with the captured message',
19+
20+
event_id: errorEvent.event_id,
21+
name: 'John Doe',
22+
});
23+
});

dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/behaviour-client.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ test('Sends a client-side exception to Sentry', async ({ page }) => {
4747
.toBe(200);
4848
});
4949

50-
test('Sends a pageload transaction to Sentry', async ({ page }) => {
50+
// Skipping test because of flake
51+
test.skip('Sends a pageload transaction to Sentry', async ({ page }) => {
5152
await page.goto('/');
5253

5354
const recordedTransactionsHandle = await page.waitForFunction(() => {
@@ -106,7 +107,8 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
106107
expect(hadPageLoadTransaction).toBe(true);
107108
});
108109

109-
test('Sends a navigation transaction to Sentry', async ({ page }) => {
110+
// Skipped because of test flake
111+
test.skip('Sends a navigation transaction to Sentry', async ({ page }) => {
110112
await page.goto('/');
111113

112114
// Give pageload transaction time to finish

dev-packages/e2e-tests/test-applications/create-remix-app/tests/behaviour-client.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const authToken = process.env.E2E_TEST_AUTH_TOKEN;
77
const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG;
88
const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
99

10-
test('Sends a client-side exception to Sentry', async ({ page }) => {
10+
// skipping flaky test
11+
test.skip('Sends a client-side exception to Sentry', async ({ page }) => {
1112
await page.goto('/');
1213

1314
const exceptionButton = page.locator('id=exception-button');
@@ -47,7 +48,8 @@ test('Sends a client-side exception to Sentry', async ({ page }) => {
4748
.toBe(200);
4849
});
4950

50-
test('Sends a pageload transaction to Sentry', async ({ page }) => {
51+
// skipping flaky test
52+
test.skip('Sends a pageload transaction to Sentry', async ({ page }) => {
5153
await page.goto('/');
5254

5355
const recordedTransactionsHandle = await page.waitForFunction(() => {

0 commit comments

Comments
 (0)