Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

desktop playback error handling #638

Merged
merged 7 commits into from
Mar 3, 2022

Conversation

ibeckermayer
Copy link

@ibeckermayer ibeckermayer commented Mar 2, 2022

Adds UI support for error messages during desktop session playback. There are three cases where we want to display an error message:

1. There is a backend error during playback

In this case, I've crafted a new json message that may be sent back by the playback player (i.e. here) of the form

{
    "message": "error",
    "errorText": "some error text"
}

which is handled by the PlayerClient here and here.

Screen Shot 2022-03-02 at 17 59 03 (2)

2. A TDP error happened during the session that's being played

Since I needed to create this error display regardless, I figured I may as well add support for displaying TDP error messages if the session ended with one. This was relatively simple to slot in, since the tdp Client which PlayerClient inherits already knows how to handle them.

To do this, I told our server to record errors and then defined the relevant TdpClientCanvas prop to handle them.

Screen Shot 2022-03-02 at 18 06 35 (2)

network error

If the websocket disconnects for some unknown reason, we just display this error

Screen Shot 2022-03-02 at 18 08 26 (2)

closes #574
closes #575
corresponds with gravitational/teleport#10765

packages/teleport/src/Player/DesktopPlayer.tsx Outdated Show resolved Hide resolved
packages/teleport/src/Player/DesktopPlayer.tsx Outdated Show resolved Hide resolved
} = useDesktopPlayer({
sid,
clusterId,
});

const displayCanvas = attempt.status === 'success' || attempt.status === '';
const displayProgressBar = attempt.status !== 'processing';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the progress bar be visible on error? also wondering if the progress bar can still be moved around on error and if that would cause errors

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided that for now it should be, since sometimes the error is actually part of the playback (i.e. if the session itself ended with a tdp error). Currently moving the progress bar doesn't actually change anything, so it isn't a problem. When it does become active, it will need to be accounted for.

@ibeckermayer ibeckermayer requested review from kimlisa and zmb3 and removed request for ravicious, hatched, gzdunek and rudream March 3, 2022 15:19
@ibeckermayer ibeckermayer merged commit 9cfa8f7 into master Mar 3, 2022
ibeckermayer pushed a commit that referenced this pull request Mar 7, 2022
@ibeckermayer ibeckermayer mentioned this pull request Mar 7, 2022
ibeckermayer pushed a commit that referenced this pull request Mar 7, 2022
* Fix clipboard sync (#628)

* Maintain aspect ratio on Desktop Playback (#635)

* only synchronize clipboards if data was or is going to be sent (#640)

* desktop playback error handling (#638)

* smooth out progress bar (#648)
@zmb3 zmb3 deleted the isaiah/desktop-playback-error-handling branch September 9, 2022 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle errors in DesktopPlayer Polish Player edge case
4 participants