Ensure sharing remains enabled if the initial desktop connection attempt fails#55350
Ensure sharing remains enabled if the initial desktop connection attempt fails#55350
Conversation
| ...prevState, | ||
| isSharing: false, | ||
| })); | ||
| setDirectorySharingState(prevState => ({ | ||
| ...prevState, | ||
| isSharing: false, |
There was a problem hiding this comment.
There's no isSharing field in ClipboardSharingState/DirectorySharingState, so this did nothing.
There was a problem hiding this comment.
Oh my god I forgot that it's a thing in TypeScript.
There was a problem hiding this comment.
Would it be possible to write a regression test for that?
There was a problem hiding this comment.
Added. In the end I had to refactor the state, because the hardcoded check for the user agent didn't allow me test this properly.
ravicious
left a comment
There was a problem hiding this comment.
I verified that the issue was solved in Web UI and Connect and that in Firefox the app still correctly says that clipboard sharing is not supported in this browser.
| ...prevState, | ||
| isSharing: false, | ||
| })); | ||
| setDirectorySharingState(prevState => ({ | ||
| ...prevState, | ||
| isSharing: false, |
There was a problem hiding this comment.
Oh my god I forgot that it's a thing in TypeScript.
…n attempt fails (#55455) * Ensure sharing remains enabled if the initial desktop connection attempt fails (#55350) * Ensure sharing remains enabled if the initial desktop connection attempt fails * Refactor sharing state * Add test * Center "more actions" button vertically (cherry picked from commit 1562144) * Remove test
Currently, if the initial desktop connection fails (for example, because the desktop is not available), we reset the sharing state to its default. However, when the user clicks "Reconnect", the sharing state is not updated, so sharing remains disabled even if the connection succeeds.
I fixed that by resetting only the part that shows if we "currently" share something (which makes sense only for directory sharing, clipboard sharing is always active if ACL and the browser support it).
Generally, the entire state should be refactored, as we keep there things that shouldn't be there at all (like a flag if sharing is supported by the browser). I left a TODO for that.
changelog: Fixed a bug that caused clipboard and directory sharing to remain unavailable when the initial desktop connection failed