Skip to content

Commit

Permalink
Update migration guide for captureUserFeedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiborza committed Dec 23, 2024
1 parent f048fff commit 16c451b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ sentryTest('should capture simple user feedback', async ({ getLocalTestUrl, page

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

expect(eventData.contexts).toMatchObject(expect.objectContaining({
feedback: {
contact_email: 'test_email',
message: 'test_comments',
name: 'test_name',
}
}))
expect(eventData.contexts).toMatchObject(
expect.objectContaining({
feedback: {
contact_email: 'test_email',
message: 'test_comments',
name: 'test_name',
},
}),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ sentryTest('capture user feedback when captureException is called', async ({ get
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;

expect(feedback.contexts).toEqual(expect.objectContaining({
feedback: {
associated_event_id: errorEvent.event_id,
message: 'This feedback should be attached associated with the captured error',
contact_email: '[email protected]',
name: 'John Doe',
}
}));
expect(feedback.contexts).toEqual(
expect.objectContaining({
feedback: {
associated_event_id: errorEvent.event_id,
message: 'This feedback should be attached associated with the captured error',
contact_email: '[email protected]',
name: 'John Doe',
},
}),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ sentryTest('capture user feedback when captureMessage is called', async ({ getLo
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
const feedback = ('exception' in data[0] ? data[1] : data[0]) as FeedbackEvent;

expect(feedback.contexts).toEqual(expect.objectContaining({
message: 'This feedback should be attached associated with the captured message',
contact_email: '[email protected]',
associated_event_id: errorEvent.event_id,
name: 'John Doe',
}));
expect(feedback.contexts).toEqual(
expect.objectContaining({
feedback: {
message: 'This feedback should be attached associated with the captured message',
contact_email: '[email protected]',
associated_event_id: errorEvent.event_id,
name: 'John Doe',
},
}),
);
});
6 changes: 5 additions & 1 deletion docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Sentry.init({

- 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.

### `@sentry/browser`

- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.

### Uncategorized (TODO)

TODO
Expand Down Expand Up @@ -130,7 +134,7 @@ Sentry.init({

### `@sentry/browser`

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

### `@sentry/nestjs`

Expand Down

0 comments on commit 16c451b

Please sign in to comment.