Skip to content
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

cannot update to current alpha #17553

Closed
burmancomp opened this issue Dec 19, 2024 · 4 comments · Fixed by #17561
Closed

cannot update to current alpha #17553

burmancomp opened this issue Dec 19, 2024 · 4 comments · Fixed by #17561
Assignees
Labels
feature/update-check release/blocking this issue blocks the milestone release
Milestone

Comments

@burmancomp
Copy link
Contributor

Steps to reproduce:

When trying to update I get following error:

IO - speech.speech.speak (09:14:10.280) - MainThread (10664):
Speaking ['Update now', 'button', 'ALT + ', CharacterModeCommand(True), 'u', CharacterModeCommand(False), CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (09:14:19.393) - winInputHook (13108):
Input: kb(laptop):space
IO - speech.speech.speak (09:14:19.420) - MainThread (10664):
Speaking ['väli', EndUtteranceCommand()]
IO - speech.speech.speak (09:14:19.420) - MainThread (10664):
Speaking ['pressed']
ERROR - core.triggerNVDAExit (09:14:19.510) - MainThread (10664):
NVDA cannot exit safely, ensure open dialogs are closed
ERROR - updateCheck._executeUpdate (09:14:19.530) - MainThread (10664):
NVDA already in process of exiting, this indicates a logic error.

This happens also after reboot.

Actual behavior:

Expected behavior:

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

Windows version:

w10 22h2

Name and version of other software in use when reproducing the issue:

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

If NVDA add-ons are disabled, is your problem still occurring?

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

@CyrilleB79
Copy link
Collaborator

Cc @SaschaCowley

@SaschaCowley
Copy link
Member

Notes:
This is because updateCheck.UpdateDownloader._downloadSuccess calls UpdateAskInstallDialog via gui.runScriptModalDialog. runScriptModalDialog has been updated to actually treat the dialogs it creates as dialogs (IE, to increment gui.message._messageBoxCounter), on the expectation that any side effects from dialogs it calls would either not be bothered by this behaviour, or would be executed in the callback function. However, UpdateAskInstallDialog calls the update directly on the press of its update button. Since the update process needs NVDA to exit safely, it fails because the dialog hasn't been hidden yet, so NVDA says it's not safe to exit, because the dialog is still open.
There are a couple of options here:

  1. Restore the old behaviour of runScriptModalDialog whereby it doesn't actually perform the normal dialog actions.
  2. Remove the callback functions from being directly in UpdateAskInstallDialog, but instead as a function passed to runScriptModalDialog.
  3. Rewrite the update process to use the new message dialog API entirely.

@SaschaCowley SaschaCowley self-assigned this Dec 20, 2024
@SaschaCowley SaschaCowley added this to the 2025.1 milestone Dec 20, 2024
@SaschaCowley SaschaCowley added feature/update-check release/blocking this issue blocks the milestone release labels Dec 20, 2024
@SaschaCowley
Copy link
Member

@burmancomp we will be temporarily rolling back the work that introduced this bug until we can implement a fix in the new year. In the meantime, based on my testing, you can get around this by selecting to postpone the update, then checking for updates again and selecting to install the previously downloaded copy. You can also manually download the latest alpha from our development snapshots page.

@burmancomp
Copy link
Contributor Author

Postponing and installing workaround worked for me, thanks.

Merry Christmas and a Happy New Year!

SaschaCowley added a commit that referenced this issue Jan 8, 2025
Closes #13007
Closes #12344
Closes #12353

Summary of the issue:

This is the second PR to merge the message dialog API into NVDA. The previous merge was at `f437723`.
See #17304 for full implementation details.
The original PR was reverted by #17561, due to #17553 and #17560.

Description of user facing changes
This PR does not, in itself, introduce any end-user facing changes. However, it lays the groundwork for closing a number of issues.

Tasks
- [x] Fix the COM registration fixing tool (#17560)
- [x] Fix NVDA updates (#17553)

Description of development approach
Restored `gui.nvdaControls.MessageDialog` inheriting from `ContextHelpMixin`, which was accidentally lost.

Changed `updateCheck.UpdateAskInstallDialog.onUpdateButton` and `onPostponeButton` to simply end the modal, returning the appropriate code. Added a static method to `UpdateAskInstallDialog` which returns a callback function which, when given the return code from `UpdateAskInstallDialog`, performs the appropriate action. Added a property method to generate this callback function given the attributes of the instance on which it is called.

Testing strategy:
Created a portable copy of NVDA (`scons dist`), and tested running the CRFT:

- Running and granting permission - works as expected
- Running and denying permission - works as expected
- Cancelling - works as expected

Added `updateVersionType="snapshot:alpha" to `source/versionInfo.py`, and tested updating with NVDA running from source:

1. Attempt updating via NVDA menu -> Help -> Check for update... -> Download update -> Update - works as expected
2. Update by downloading then postponing update, then exit NVDA -> Install pending update
    a. Without incompatible updates installed - works as expected
    b. With incompatible updates installed - works as expected
3. Update by downloading then postponing update, restarting NVDA, then NVDA menu -> Install pending update - works as expected
4. Update by downloading then postponing update, restarting NVDA, then accepting the prompt to install the update - works as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/update-check release/blocking this issue blocks the milestone release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants