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

SharedDirectoryMoveResponse#1074

Merged
ibeckermayer merged 12 commits intomasterfrom
isaiah/sd-move-response
Aug 5, 2022
Merged

SharedDirectoryMoveResponse#1074
ibeckermayer merged 12 commits intomasterfrom
isaiah/sd-move-response

Conversation

@ibeckermayer
Copy link
Copy Markdown

@ibeckermayer ibeckermayer commented Aug 2, 2022

Unfortunately when doing research for this feature, I failed to notice that the browser API I was planning to use for moving files and directories was unfinished #1064.

In the meantime, I've decided to make all error notifications show up in a modal (instead of a banner), and make a distinction between fatal and non-fatal errors, with non-fatal errors being displayed as a dismissible modal

image

and fatal errors showing up as a modal with a button that allows you to refresh the page

image

(See the video at the very bottom of this description for the modals in action).

Playback is currently unaffected by these changes, because directory sharing events are not captured or played back, the only non-fatal error is thrown by a directory sharing message. When this changes, we may need to refactor the playback system to handle non-fatal errors accurately.

Requires backport to v9/v10

closes #615

How to test manually

webapps

  1. Change the value below to true
    enableDirectorySharing: false, // note to reviewers: should be false in any PRs.
  2. run the development server like yarn start-teleport --target=https://ec2-35-171-27-185.compute-1.amazonaws.com/
  3. See https://gravitational.slack.com/archives/C02DQ1C2BMW/p1657807702085829 for a username/password combo

What to expect

Go to the top right ... menu and click Share Directory

image

(X-out of the "uncaught exception" screen if you get it). The directory you select should show up in the File Explorer as a shared drive

Screen Shot 2022-07-19 at 14 13 45

The drive should be navigable as well should any folders within it

image

Try moving the file from one folder in the shared directory to another, and you should see something like

sd-move-response.mov

Comment thread packages/teleport/src/DesktopSession/DesktopSession.tsx Outdated
Comment thread packages/teleport/src/lib/tdp/client.ts Outdated
Comment thread packages/teleport/src/DesktopSession/DesktopSession.tsx Outdated
} else if (clipboardError) {
errorText = clipboardState.errorText || 'clipboard sharing failed';
} else if (unknownConnectionError) {
errorText = 'Session disconnected for an unknown reason';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
errorText = 'Session disconnected for an unknown reason';
errorText = 'Session disconnected for an unknown reason. Try reloading (or refreshing) the browser.';

and then the button could say Reload or Refresh?

also i'm confused whether our error messages should be all lower cap or properly capitalized with punctuation. I'm just seeing a mixture of both. It's not a big deal to me but just wondering in general

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

also i'm confused whether our error messages should be all lower cap or properly capitalized with punctuation.

In my opinion if we're displaying it as a message to the user, we should strive to give it proper capitalization and punctuation.

Comment thread packages/teleport/src/DesktopSession/DesktopSession.tsx Outdated
Comment thread packages/teleport/src/DesktopSession/DesktopSession.tsx Outdated
}

// | message type (24) | completion_id uint32 | err_code uint32 |
encodeSharedDirectoryMoveResponse(res: SharedDirectoryMoveResponse): Message {
Copy link
Copy Markdown
Contributor

@JanKaczmarkiewicz JanKaczmarkiewicz Aug 4, 2022

Choose a reason for hiding this comment

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

What do you think of an declarative approach for encoding similar to #1003 (comment)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@ibeckermayer ibeckermayer enabled auto-merge (squash) August 4, 2022 19:40
@ibeckermayer ibeckermayer merged commit cd12246 into master Aug 5, 2022
ibeckermayer pushed a commit that referenced this pull request Aug 23, 2022
ibeckermayer pushed a commit that referenced this pull request Aug 24, 2022
* `SharedDirectoryInfoResponse` (#996)

* `SharedDirectoryListRequest` (#999)

* `SharedDirectoryListResponse` (#1000)

* `SharedDirectoryReadRequest` (#1003)

* `SharedDirectoryReadResponse` (#1005)

* `SharedDirectoryWriteRequest` (#1007)

* `SharedDirectoryWriteResponse` (#1008)

* Tidy up `sharedDirectoryManager` (#1010)

* `SharedDirectoryMoveRequest` (#1045)

* `SharedDirectoryMoveResponse` (#1074)

* `SharedDirectoryCreateRequest` and `SharedDirectoryCreateResponse` (#1090)

* SharedDirectoryDeleteRequest and SharedDirectoryDeleteResponse (#1096)

* Add warning dialog for unsupported browsers for directory sharing (#1110)

* updates yarn.lock
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.

Create TdpClientEvent.CLIENT_ERROR event in lib/tdp/client.ts

3 participants