Fix add-on store downloads after cancellation#20017
Merged
seanbudd merged 8 commits intoApr 29, 2026
Merged
Conversation
a3cdf81 to
42ceb6f
Compare
42ceb6f to
76eac0a
Compare
seanbudd
reviewed
Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a bad Add-on Store downloader state after cancelling a download, so subsequent downloads and closing the store no longer raise NoneType executor errors.
Changes:
- Refactors
AddonFileDownloaderto track per-attempt download state (including per-attempt temp file path) and ignore stale/completing workers from prior attempts. - Makes
cancelAll()shut down and allow safe recreation of the executor/resources so the downloader instance can be reused. - Adds unit/regression tests covering cancel-then-retry and downloader reuse, plus a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
source/addonStore/network.py |
Introduces per-attempt state tracking and safer cancellation/retry behavior in AddonFileDownloader. |
tests/unit/test_addonStoreNetwork.py |
Adds unit tests for cancel/retry scenarios and executor/directory recreation after cancellation. |
user_docs/en/changes.md |
Adds a user-facing changelog entry for the fixed Add-on Store download retry behavior. |
seanbudd
reviewed
Apr 28, 2026
Contributor
Author
|
Thanks @seanbudd, I addressed these in the latest commit. I replaced the one-field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #20015
Summary of the issue:
After cancelling an add-on download by closing the Add-on Store and choosing "Yes", the store can get into a bad state.
If the user opens it again and starts another download, NVDA can raise:
Closing the store again after that can also raise:
Description of user facing changes:
After cancelling a download, the Add-on Store can be used again normally.
Starting another download no longer throws those exceptions.
Closing the store again after that also works as expected.
Description of developer facing changes:
AddonFileDownloadernow tracks state per download attempt.This prevents an older cancelled worker from interfering with a later retry of the same add-on.
Description of development approach:
The fix updates the downloader so each download attempt has its own state and temporary file path.
After
cancelAll(), the downloader can recreate its executor and be reused safely.When a worker finishes, it now checks whether it still belongs to the active attempt before updating progress, cleaning up files, or completing the download.
Testing strategy:
Manual testing:
Expected result:
submitorshutdownexception is logged.Automated testing:
cancelAll().Known issues with pull request:
None known.
Code Review Checklist: