Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix: add hasrecording to view recording button on event (#66009)

Christian Raffertyf59ee0d3de19
diff --git a/frontend/src/lib/components/ViewRecordingButton/ViewRecordingButton.tsx b/frontend/src/lib/components/ViewRecordingButton/ViewRecordingButton.tsx
index bd50dbaea8fa..86463c362acc 100644
--- a/frontend/src/lib/components/ViewRecordingButton/ViewRecordingButton.tsx
+++ b/frontend/src/lib/components/ViewRecordingButton/ViewRecordingButton.tsx
@@ -263,8 +263,13 @@ export const recordingDisabledReason = (
const recordingWarningReason = (
recordingDuration: number | undefined,
minimumDuration: number | undefined,
- recordingStatus: string | undefined
+ recordingStatus: string | undefined,
+ hasRecording: boolean | undefined
): string | undefined => {
+ // These warnings only caveat that a recording might not exist. Once we know one does, they're just confusing.
+ if (hasRecording === true) {
+ return undefined
+ }
if (recordingDuration && minimumDuration && recordingDuration < minimumDuration) {
const minimumDurationInSeconds = minimumDuration / 1000
return `There is a chance this recording was not captured because the event happened earlier than the ${minimumDurationInSeconds}s minimum session duration.`
@@ -309,7 +314,7 @@ export function useRecordingButton({
}
const disabledReason = recordingDisabledReason(sessionId, recordingStatus, hasRecording)
- const warningReason = recordingWarningReason(recordingDuration, minimumDuration, recordingStatus)
+ const warningReason = recordingWarningReason(recordingDuration, minimumDuration, recordingStatus, hasRecording)
return { onClick, disabledReason, warningReason }
}