Skip to content

Error message for users when pushClipboard remote tool used with no connection#17991

Closed
rachanabhandiwad wants to merge 1 commit into
nvaccess:masterfrom
rachanabhandiwad:pushClipboardFix
Closed

Error message for users when pushClipboard remote tool used with no connection#17991
rachanabhandiwad wants to merge 1 commit into
nvaccess:masterfrom
rachanabhandiwad:pushClipboardFix

Conversation

@rachanabhandiwad

@rachanabhandiwad rachanabhandiwad commented Apr 20, 2025

Copy link
Copy Markdown

Link to issue number:

#17947

Summary of the issue:

Previously, when attempting to push clipboard content to a remote machine without a connection, NVDA would silently fail or show a message via ui.message(). This behavior wasn't accessible for non-visual users in all contexts and was inconsistent with other parts of NVDA that use structured exception handling.

Description of user facing changes

Users now receive a spoken error message when pushing clipboard content fails due to no connection

Description of development approach

  • Updated pushClipboard() to raise RuntimeError instead of silently failing or calling ui.message(). This allows higher-level functions to handle the error and present it in a consistent, user-facing way.

  • Updated script_pushClipboard() to catch RuntimeError and call ui.message() after logging the traceback. This pattern is consistent with how other NVDA script actions handle errors.

  • Updated unit test test_pushClipboardNoConnection() to expect RuntimeError rather than assert ui.message() calls.

Testing strategy:

  • Ran unit tests, including updated test_pushClipboardNoConnection, to confirm exceptions are raised and contain the correct error message.

  • Manually tested clipboard pushing with and without a connection using the remote add-on.

Known issues with pull request:

  • Does not address sending Ctrl+Alt+Delete or system-reserved commands. These still fail silently or require a different mechanism.
  • This solution is a minimal improvement

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

@rachanabhandiwad rachanabhandiwad requested a review from a team as a code owner April 20, 2025 19:12
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit ab248ca57a

@SaschaCowley

Copy link
Copy Markdown
Member

This approach is not appropriate. The speech should be queued with SPRI.NEXT instead.

@SaschaCowley SaschaCowley marked this pull request as draft April 22, 2025 00:15
@seanbudd seanbudd changed the title Error message for users when pushClipboard remote tool used with no c… Error message for users when pushClipboard remote tool used with no connection Apr 29, 2025
@SaschaCowley

Copy link
Copy Markdown
Member

@rachanabhandiwad do you plan to continue work on this PR?

@seanbudd seanbudd added this to the 2025.1 milestone May 6, 2025
@SaschaCowley SaschaCowley added the stale PR is stale/old - NV Access has missed reviewing this or this is an abandoned draft label May 8, 2025
SaschaCowley added a commit that referenced this pull request May 9, 2025
…e NVDA Menu (#18070)

Closes #17947
Supersedes #17991 

Summary of the issue:
When executing some Remote Access actions via the Remote Access submenu
in the NVDA menu, the status is interrupted by the focus changing,
making the messages useless.

Description of user facing changes
Remote Access actions performed via the NVDA menu should now correctly
report their status.

Description of development approach
- Add a `delayedMessage` function to `ui`, based on the approach taken
for focusing open blocking modals in #17582.
- Remove the now duplicated code, and replace it with a call to
`ui.delayedMessage`.
- In `_remoteClient.client.RemoteClient`, updated `copyLink`,
`pushClipboard`, and `toggleMute`, to use `ui.delayedMessage` instead of
`ui.message`, as these methods can be envoked directly from the menu.
- Also moved the success message out of
`globalCommands.GlobalCommands.script_copyRemoteLink` into
`_remoteClient.client.RemoteClient.copyLink`.
- Updated `_remoteClient.cues._playCue` to use `ui.delayedMessage`
instead of `ui.message`, as the "Disconnect" menu item causes a cue to
be issued. This means that cues should work even if issued at the same
time as a UI change, and should have very little performance impact.

Testing strategy:
- Performed the above listed commands with and without a Remote Access
session in progress.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR is stale/old - NV Access has missed reviewing this or this is an abandoned draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants