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: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index b1ae8743159..0d9aec6245e 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 add-on updates are pending no longer results in the add-on being removed. (#16837) ### Changes for Developers