From 1f93557d456a4c00549ce02610a9507c3c6fc7c7 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 18 Apr 2024 14:08:05 -0400 Subject: [PATCH] fix(replay): Replay preview broken due to extra re-render Due to https://github.com/getsentry/sentry/pull/69152, missed removing `organization` from `useEffect` deps causing a re-render and incorrect loading state to happen when you first press "play" on the replay. We should look into making the player a bit more resilient to this, but in the meantime this should fix the bug. --- .../events/eventReplay/replayPreviewPlayer.tsx | 2 +- static/app/views/replays/details.tsx | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/static/app/components/events/eventReplay/replayPreviewPlayer.tsx b/static/app/components/events/eventReplay/replayPreviewPlayer.tsx index 89f6d7fdd353ca..92259d0d9c075c 100644 --- a/static/app/components/events/eventReplay/replayPreviewPlayer.tsx +++ b/static/app/components/events/eventReplay/replayPreviewPlayer.tsx @@ -82,7 +82,7 @@ function ReplayPreviewPlayer({ if (replayRecord && !replayRecord.has_viewed && !isFetching && isPlaying) { markAsViewed({projectSlug: replayRecord.project_id, replayId: replayRecord.id}); } - }, [isFetching, isPlaying, markAsViewed, organization, replayRecord]); + }, [isFetching, isPlaying, markAsViewed, replayRecord]); return ( diff --git a/static/app/views/replays/details.tsx b/static/app/views/replays/details.tsx index 04c9a0d60935f9..eee34b1ee5d9db 100644 --- a/static/app/views/replays/details.tsx +++ b/static/app/views/replays/details.tsx @@ -83,15 +83,7 @@ function ReplayDetails({params: {replaySlug}}: Props) { ) { markAsViewed({projectSlug, replayId}); } - }, [ - fetchError, - fetching, - markAsViewed, - organization, - projectSlug, - replayId, - replayRecord, - ]); + }, [fetchError, fetching, markAsViewed, projectSlug, replayId, replayRecord]); const initialTimeOffsetMs = useInitialTimeOffsetMs({ orgSlug,