Skip to content

Commit 4c72d87

Browse files
committed
Update migration guide for captureUserFeedback
1 parent f048fff commit 4c72d87

File tree

4 files changed

+34
-22
lines changed
  • dev-packages/browser-integration-tests/suites/public-api/captureFeedback
  • docs/migration

4 files changed

+34
-22
lines changed

dev-packages/browser-integration-tests/suites/public-api/captureFeedback/simple_feedback/test.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ sentryTest('should capture simple user feedback', async ({ getLocalTestUrl, page
99

1010
const eventData = await getFirstSentryEnvelopeRequest<FeedbackEvent>(page, url);
1111

12-
expect(eventData.contexts).toMatchObject(expect.objectContaining({
13-
feedback: {
14-
contact_email: 'test_email',
15-
message: 'test_comments',
16-
name: 'test_name',
17-
}
18-
}))
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+
);
1921
});

dev-packages/browser-integration-tests/suites/public-api/captureFeedback/withCaptureException/test.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ sentryTest('capture user feedback when captureException is called', async ({ get
1414
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
1515
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;
1616

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

dev-packages/browser-integration-tests/suites/public-api/captureFeedback/withCaptureMessage/test.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ sentryTest('capture user feedback when captureMessage is called', async ({ getLo
1414
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
1515
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;
1616

17-
expect(feedback.contexts).toEqual(expect.objectContaining({
18-
message: 'This feedback should be attached associated with the captured message',
19-
contact_email: '[email protected]',
20-
associated_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
});

docs/migration/v8-to-v9.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ Sentry.init({
7272

7373
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default. This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
7474

75+
### `@sentry/browser`
76+
77+
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
78+
7579
### Uncategorized (TODO)
7680

7781
TODO
@@ -130,7 +134,7 @@ Sentry.init({
130134

131135
### `@sentry/browser`
132136

133-
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead as a drop-in replacement.
137+
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
134138

135139
### `@sentry/nestjs`
136140

0 commit comments

Comments
 (0)