Skip to content

Commit

Permalink
Fix not found error for web ssh session recordings (#48855)
Browse files Browse the repository at this point in the history
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: #48395
  • Loading branch information
avatus authored Nov 13, 2024
1 parent 1b0f8df commit fa2e013
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Player/DesktopPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion web/packages/teleport/src/Player/SshPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa2e013

Please sign in to comment.