From 451003bdd2ae84a889b0dd706a9c2450577ade14 Mon Sep 17 00:00:00 2001 From: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:31:25 +1000 Subject: [PATCH 1/3] Added check for `NVDAState.shouldWriteToDisk` when attempting to complete addon installation or removal --- source/addonHandler/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/addonHandler/__init__.py b/source/addonHandler/__init__.py index d456d6eabbf..ef7ae939612 100644 --- a/source/addonHandler/__init__.py +++ b/source/addonHandler/__init__.py @@ -337,7 +337,7 @@ def _getAvailableAddonsFromPath( log.debug("Listing add-ons from %s", path) for p in os.listdir(path): if p.endswith(DELETEDIR_SUFFIX): - if isFirstLoad: + if isFirstLoad and NVDAState.shouldWriteToDisk(): removeFailedDeletion(os.path.join(path, p)) continue addon_path = os.path.join(path, p) @@ -351,6 +351,7 @@ def _getAvailableAddonsFromPath( name = a.manifest["name"] if ( isFirstLoad + and NVDAState.shouldWriteToDisk() and name in state[AddonStateCategory.PENDING_REMOVE] and not a.path.endswith(ADDON_PENDINGINSTALL_SUFFIX) ): @@ -360,9 +361,13 @@ def _getAvailableAddonsFromPath( except RuntimeError: log.exception(f"Failed to remove {name} add-on") _failedPendingRemovals.add(name) - if isFirstLoad and ( - name in state[AddonStateCategory.PENDING_INSTALL] - or a.path.endswith(ADDON_PENDINGINSTALL_SUFFIX) + if ( + isFirstLoad + and NVDAState.shouldWriteToDisk() + and ( + name in state[AddonStateCategory.PENDING_INSTALL] + or a.path.endswith(ADDON_PENDINGINSTALL_SUFFIX) + ) ): newPath = a.completeInstall() if newPath: From 7765dada3c5f28141fdb3123eec63452afcc1d88 Mon Sep 17 00:00:00 2001 From: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:06:36 +1000 Subject: [PATCH 2/3] Added changelog entry --- user_docs/en/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index b1ae8743159..aed2a0879d0 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -42,6 +42,7 @@ The available options are: * Improvements in Microsoft PowerPoint: (#17004) * It is now possible to use braille display routing keys to move the text cursor. (#9101) * It is now possible to use the review cursor selection commands to select text. +* Updating NVDA while NVDA updates are pending no longer results in the add-on being removed. (#16837) ### Changes for Developers From bd7956867eb37260aef97c95e1147cce489655d7 Mon Sep 17 00:00:00 2001 From: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:51:18 +1000 Subject: [PATCH 3/3] Update user_docs/en/changes.md Co-authored-by: Sean Budd --- user_docs/en/changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index aed2a0879d0..0d9aec6245e 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -42,7 +42,7 @@ The available options are: * Improvements in Microsoft PowerPoint: (#17004) * It is now possible to use braille display routing keys to move the text cursor. (#9101) * It is now possible to use the review cursor selection commands to select text. -* Updating NVDA while NVDA updates are pending no longer results in the add-on being removed. (#16837) +* Updating NVDA while add-on updates are pending no longer results in the add-on being removed. (#16837) ### Changes for Developers