Skip to content

Commit 8137807

Browse files
authored
Merge branch 'develop' into fix/fetch-not-release
2 parents 78d4453 + cd44589 commit 8137807

File tree

43 files changed

+241
-2053
lines changed

Some content is hidden

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

43 files changed

+241
-2053
lines changed

.craft.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,27 @@ targets:
99
- name: npm
1010
id: '@sentry/types'
1111
includeNames: /^sentry-types-\d.*\.tgz$/
12-
## 1.2 Utils
13-
# TODO(v9): Remove
14-
- name: npm
15-
id: '@sentry/utils'
16-
includeNames: /^sentry-utils-\d.*\.tgz$/
17-
## 1.3 Core SDK
12+
## 1.2 Core SDK
1813
- name: npm
1914
id: '@sentry/core'
2015
includeNames: /^sentry-core-\d.*\.tgz$/
21-
## 1.4 Browser Utils package
16+
## 1.3 Browser Utils package
2217
- name: npm
2318
id: '@sentry-internal/browser-utils'
2419
includeNames: /^sentry-internal-browser-utils-\d.*\.tgz$/
25-
## 1.5 Replay Internal package (browser only)
20+
## 1.4 Replay Internal package (browser only)
2621
- name: npm
2722
id: '@sentry-internal/replay'
2823
includeNames: /^sentry-internal-replay-\d.*\.tgz$/
29-
## 1.6 OpenTelemetry package
24+
## 1.5 OpenTelemetry package
3025
- name: npm
3126
id: '@sentry/opentelemetry'
3227
includeNames: /^sentry-opentelemetry-\d.*\.tgz$/
33-
## 1.7 Feedback package (browser only)
28+
## 1.6 Feedback package (browser only)
3429
- name: npm
3530
id: '@sentry-internal/feedback'
3631
includeNames: /^sentry-internal-feedback-\d.*\.tgz$/
37-
## 1.8 ReplayCanvas package (browser only)
32+
## 1.7 ReplayCanvas package (browser only)
3833
- name: npm
3934
id: '@sentry-internal/replay-canvas'
4035
includeNames: /^sentry-internal-replay-canvas-\d.*\.tgz$/
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Sentry.captureUserFeedback({
1+
Sentry.captureFeedback({
22
eventId: 'test_event_id',
33
email: 'test_email',
4-
comments: 'test_comments',
4+
message: 'test_comments',
55
name: 'test_name',
66
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { expect } from '@playwright/test';
2+
import type { FeedbackEvent } from '@sentry/core';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
6+
7+
sentryTest('should capture simple user feedback', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
9+
10+
const eventData = await getFirstSentryEnvelopeRequest<FeedbackEvent>(page, url);
11+
12+
expect(eventData.contexts).toMatchObject(
13+
expect.objectContaining({
14+
feedback: {
15+
contact_email: 'test_email',
16+
message: 'test_comments',
17+
name: 'test_name',
18+
},
19+
}),
20+
);
21+
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
beforeSend(event) {
8-
Sentry.captureUserFeedback({
9-
event_id: event.event_id,
8+
Sentry.captureFeedback({
9+
associatedEventId: event.event_id,
1010
name: 'John Doe',
1111
12-
comments: 'This feedback should be attached associated with the captured message',
12+
message: 'This feedback should be attached associated with the captured error',
1313
});
1414
return event;
1515
},
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
import { expect } from '@playwright/test';
2-
import type { Event, UserFeedback } from '@sentry/core';
2+
import type { Event, FeedbackEvent } from '@sentry/core';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
66

77
sentryTest('capture user feedback when captureException is called', async ({ getLocalTestUrl, page }) => {
88
const url = await getLocalTestUrl({ testDir: __dirname });
99

10-
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | UserFeedback)[];
10+
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | FeedbackEvent)[];
1111

1212
expect(data).toHaveLength(2);
1313

1414
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;
15+
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;
1616

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-
});
17+
expect(feedback.contexts).toEqual(
18+
expect.objectContaining({
19+
feedback: {
20+
associated_event_id: errorEvent.event_id,
21+
message: 'This feedback should be attached associated with the captured error',
22+
contact_email: '[email protected]',
23+
name: 'John Doe',
24+
},
25+
}),
26+
);
2327
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
beforeSend(event) {
8-
Sentry.captureUserFeedback({
9-
event_id: event.event_id,
8+
Sentry.captureFeedback({
9+
associatedEventId: event.event_id,
1010
name: 'John Doe',
1111
12-
comments: 'This feedback should be attached associated with the captured error',
12+
message: 'This feedback should be attached associated with the captured message',
1313
});
1414
return event;
1515
},
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
import { expect } from '@playwright/test';
2-
import type { Event, UserFeedback } from '@sentry/core';
2+
import type { Event, FeedbackEvent } from '@sentry/core';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
66

77
sentryTest('capture user feedback when captureMessage is called', async ({ getLocalTestUrl, page }) => {
88
const url = await getLocalTestUrl({ testDir: __dirname });
99

10-
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | UserFeedback)[];
10+
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | FeedbackEvent)[];
1111

1212
expect(data).toHaveLength(2);
1313

1414
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;
15+
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;
1616

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-
});
17+
expect(feedback.contexts).toEqual(
18+
expect.objectContaining({
19+
feedback: {
20+
message: 'This feedback should be attached associated with the captured message',
21+
contact_email: '[email protected]',
22+
associated_event_id: errorEvent.event_id,
23+
name: 'John Doe',
24+
},
25+
}),
26+
);
2327
});

0 commit comments

Comments
 (0)