From 9e94314b605a1ace32745733837cec3fa6e7c6fa Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Tue, 6 Feb 2024 16:28:03 -0500 Subject: [PATCH] fix(feedback): Replay breadcrumb for feedback events was incorrect We are creating a replay breadcrumb when user feedback was submitted, however, the it was not typed correctly, which the timestamp not being included in the proper location. --- .../replay/src/coreHandlers/util/addFeedbackBreadcrumb.ts | 7 ++++--- packages/replay/src/types/replayFrame.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/replay/src/coreHandlers/util/addFeedbackBreadcrumb.ts b/packages/replay/src/coreHandlers/util/addFeedbackBreadcrumb.ts index 0e08b459d3ca..39fc2923cabd 100644 --- a/packages/replay/src/coreHandlers/util/addFeedbackBreadcrumb.ts +++ b/packages/replay/src/coreHandlers/util/addFeedbackBreadcrumb.ts @@ -1,7 +1,7 @@ import { EventType } from '@sentry-internal/rrweb'; import type { FeedbackEvent } from '@sentry/types'; -import type { ReplayContainer } from '../../types'; +import type { ReplayBreadcrumbFrameEvent, ReplayContainer } from '../../types'; /** * Add a feedback breadcrumb event to replay. @@ -21,16 +21,17 @@ export function addFeedbackBreadcrumb(replay: ReplayContainer, event: FeedbackEv type: EventType.Custom, timestamp: event.timestamp * 1000, data: { - timestamp: event.timestamp, tag: 'breadcrumb', payload: { + timestamp: event.timestamp, + type: 'default', category: 'sentry.feedback', data: { feedbackId: event.event_id, }, }, }, - }); + } as ReplayBreadcrumbFrameEvent); return false; }); diff --git a/packages/replay/src/types/replayFrame.ts b/packages/replay/src/types/replayFrame.ts index 3a595e47a4cf..48dc4aa72a2a 100644 --- a/packages/replay/src/types/replayFrame.ts +++ b/packages/replay/src/types/replayFrame.ts @@ -128,7 +128,7 @@ interface ReplayOptionFrame { } interface ReplayFeedbackFrameData { - feedback_id: string; + feedbackId: string; } interface ReplayFeedbackFrame extends ReplayBaseBreadcrumbFrame {