-
-
Notifications
You must be signed in to change notification settings - Fork 678
Fix various issues when removing addons and improve state management in addonHandler
#12792
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
Fix various issues when removing addons and improve state management in addonHandler
#12792
Conversation
…t in `addonHandler`
cc @seanbudd Given you've added #12629 to 2021.3 you may want to review this. Also @CyrilleB79 your testing and review (if you have time) would be greatly appreciated. |
addonHandler
addonHandler
I have tested the STR in #12629 (comment) on a portable copy of nvda_snapshot_pr12792-23663,da8779bd.exe. Here is my feedback:
This needs to be clarified.
|
thanks for testing.
Great!
I cannot reproduce this - are you sure this was not just a coincidence?
That is quite tricky to do - I'll see what I can do.
I agree that would be nice and worth implementing at some point however there was no such warning previously. Should lack of the warning block this PR in your opinion? |
I cannot reproduce this again. Let's ignore it.
This PR is already an improvement (bugfix) with respect to the current situation. The warning message would be a plus and may be thought and integrated with this PR if possible. But in case of UX discussion, design problem or whatever, it should not block this PR in my opinion. |
@CyrilleB79 I believe I've succeeded in making add-on show up in add-ons manager with the right status i.e. "Install, enabled after restart". Can you retest? |
I have just tested the last build (portable version of nvda_snapshot_pr12792-23664,b05d9cae.exe). Regarding the warning, again, I think it would be better to have it but it should not block this PR which is already a progress with respect to what happens now. Just to say that IMO there is no need to specify which file or folder cannot be renamed/deleted. Someone wanting to know it may look at the log. |
You're looking at this from a perspective of a power user for whom looking at and understanding the log is not a problem. For a power user however, this dialog is not really necessary since they would look into the log anyway so the main group for whom a graphical warning is an improvement are beginner to intermediate users. |
If I should consider myself a power user, I would say that the friendly reminder with the warning message box is a plus, even if I can cop without it. For someone who is not used to dig into the log, there are two possibilities:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few concerns around backwards compatibility, which I have raised below. If it can't be maintained easily here, this can be looked at as a priority for 2022.1 - which isn't too far away from starting.
I also agree that a warning message may be helpful here, but it won't block this getting merged. A new issue should be raised for it, and perhaps a code comment on where it should go. |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd I believe all your review comments are now addressed. |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Thanks for addressing those comments. I was thinking the following for the changelog entry - what are your thoughts? is this accurate? I think it was worth mentioning the change specifically. Changes
Bug fixes
Changes for developers
|
IMO this should be a bug fix - this was always the intent it just never worked as it should.
The rest looks pretty nice. |
addonHandler
addonHandler
addonHandler
addonHandler
Removes code deprecated as part of PR #12792 Summary of the issue: PR #12792 converted state in addonHandler to a class deprecating some module level functions in the process. Description of how this pull request fixes the issue: Deprecated loadState and saveState are removed from addonHandler. Testing strategy: With git grep made sure that these functions are not used anywhere in the source code.
Link to issue number:
Fixes #12629
Summary of the issue:
As described in #12629 it is impossible to update add-on when its folder is opened when initiating upgrade. During investigation I also encountered various other errors during add-on removal in particular:
Description of how this pull request fixes the issue:
Point 1 i.e. add-on installation cannot be finished when add-on folder was opened during installation was caused by the fact that after attempting to install add-ons pending installation list of all add-ons pending install was emptied even if the given add-on failed to install. This has been fixed by removing add-ons from list of pending installs only if installation was successful - otherwise NVDA would retry on the next restart. In addition for configurations which can be potentially affected by this I've also made sure that for all folders which name ends with suffix denoting add-ons pending installation NVDA tries to install them regardless of their presence on the list.
Point 2 disabled add-ons are not removed from the list of disabled add-ons after uninstallation was caused by the fact that there were two lists of disabled add-ons. The first one in the state and the second one
_disabledAddons
was duplicating content of the list in the state Unfortunately the second list was populated after add-ons were removed yet names of the disabled plugins were removed from it rather than from the list in the state. This has been fixed by no longer using_disabledAddons
at all - it ended up to create more confusion than it is worth and added no real benefits. I've also make sure that for old configs all add-ons which are no longer installed which are present in the list of disabled add-ons are removed.Point 3 add-ons for which directory is named differently than the name in the manifest was solved by uninstalling add-ons after getting manifest data i.e. no longer rely on directory name matching the manifest name.
In the process I've also made addons state a class which has methods for loading, saving etc. rather than just having a simple dict with various top level function operating on it. This is backwards compatible.
Testing strategy:
Known issues with pull request:
None known
Change log entries:
Bug fixes
Code Review Checklist: