From f3f6d2cc7af6f71a7bd626ca501bfb07e9944103 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 13 Nov 2024 10:49:19 -0600 Subject: [PATCH] Fix not found error for web ssh session recordings (#48856) This adds an error message to the web UI if a session recording isn't found ![Screenshot 2024-11-12 at 1 39 48PM](https://github.com/user-attachments/assets/ef6eb916-c764-42bd-94fd-bf3828435b84) Fixes: https://github.com/gravitational/teleport/issues/48395 --- web/packages/teleport/src/Player/DesktopPlayer.tsx | 2 +- web/packages/teleport/src/Player/SshPlayer.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/packages/teleport/src/Player/DesktopPlayer.tsx b/web/packages/teleport/src/Player/DesktopPlayer.tsx index 1e2c1b3a1e2d9..a0bace9583951 100644 --- a/web/packages/teleport/src/Player/DesktopPlayer.tsx +++ b/web/packages/teleport/src/Player/DesktopPlayer.tsx @@ -69,7 +69,7 @@ export const DesktopPlayer = ({ clusterId, }); - const isError = playerStatus === StatusEnum.ERROR; + const isError = playerStatus === StatusEnum.ERROR || statusText !== ''; const isLoading = playerStatus === StatusEnum.LOADING; const isPlaying = playerStatus === StatusEnum.PLAYING; const isComplete = isError || playerStatus === StatusEnum.COMPLETE; diff --git a/web/packages/teleport/src/Player/SshPlayer.tsx b/web/packages/teleport/src/Player/SshPlayer.tsx index 878bc1c230caa..ce70754ec6f68 100644 --- a/web/packages/teleport/src/Player/SshPlayer.tsx +++ b/web/packages/teleport/src/Player/SshPlayer.tsx @@ -34,7 +34,11 @@ export default function Player({ sid, clusterId, durationMs }) { clusterId, sid ); - const isError = playerStatus === StatusEnum.ERROR; + + // statusText is currently only set when an error happens, so for now we can assume + // if it is not empty, an error occured (even if the player is in COMPLETE state, which gets + // set on close) + const isError = playerStatus === StatusEnum.ERROR || statusText !== ''; const isLoading = playerStatus === StatusEnum.LOADING; const isPlaying = playerStatus === StatusEnum.PLAYING; const isComplete = isError || playerStatus === StatusEnum.COMPLETE;