Skip to content

Fix issues with pushing the clipboard #17883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2025
Merged

Fix issues with pushing the clipboard #17883

merged 5 commits into from
Apr 9, 2025

Conversation

SaschaCowley
Copy link
Member

@SaschaCowley SaschaCowley commented Apr 2, 2025

Link to issue number:

Fixes #17881
Fixes #17875

Summary of the issue:

Currently, the push clipboard command:

  1. Fails with a logged error but no useful output when attempting to push a non-text clipboard
  2. Reports success when there is no-one else connected.

Description of user facing changes

  1. An error message is reported when attempting to push non-text clipboard
  2. An error message is reported when pushing the clipboard to an empty channel

Description of development approach

  1. Catch OSError when attempting to push clipboard, as this is raised when there is no text content on the clipboard.
  2. Record connected leaders and followers on both leader and follower sessions. Add read-only properties, connectedLeadersCount, connectedFollowersCount, and connectedClientsCount (sum of leaders and followers counts) to RemoteSession.
  3. Add a read only property, connectedClientsCount to RemoteClient, which grabs the connectedClientsCount from the appropriate session, or returns 0 if there is no session in progress.
  4. Check that the remote client's count of connected clients is greater than 0 before pushing the clipboard.

Testing strategy:

Attempt pushing the clipboard:

  • In a new channel where the local machine is the only connected machine
  • In a channel where there is a remote that connected after the local machine, and after the remote machine has disconnected
  • In a channel where there is another client that joined before the local machine, and after the remote machine has disconnected

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@seanbudd seanbudd added this to the 2025.1 milestone Apr 4, 2025
@seanbudd seanbudd changed the base branch from master to beta April 4, 2025 07:47
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Apr 8, 2025
@SaschaCowley SaschaCowley marked this pull request as ready for review April 9, 2025 04:54
@SaschaCowley SaschaCowley requested a review from a team as a code owner April 9, 2025 04:54
@SaschaCowley SaschaCowley requested a review from seanbudd April 9, 2025 04:54
@seanbudd seanbudd merged commit b0e0994 into beta Apr 9, 2025
5 checks passed
@seanbudd seanbudd deleted the remotePushClipboard branch April 9, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when attempting to push non-text clipboard Remote: push clipboard command should report an error when no remote machine is connected
2 participants