First run after anki update should trigger add-on update check

This is a feature suggestion.

For 2.1.41 I had some bug reports that my add-ons don’t work after updating Anki to .41 or .42. These problems occurred because these users were still running old versions of my add-ons and these disappeared after they checked for add-on updates or reinstalled them.

I think this problem would be fixed if the first run after anki updated triggered an add-on update check.

 

There’s a related problem: One or two reports said that an error occured even though they only had one add-on of mine running. They actually disabled all other add-on in the add-on dialog but didn’t restart so that still code from other add-ons was loaded. Maybe there could be a tooltip when you disable or uninstall an add-on that a restart is suggested?

You could accomplish the former by saving the last used version in the profile manager, and ignoring the last check time if the version has changed. Would you like to submit a PR that does that, and another that adds a tooltip?

Yes. I’d like to try this on the weekend.

Another idea: The “copy debug information” button from the help->about menu includes a list of disabled add-ons. This list is generated when the user clicks this button, i.e. add-ons that have been disabled in this session are already listed as disabled even though they still are loaded. So as an add-on developer I can’t see if the problem reported by the user actually is due to the add-ons listed as active.

Would you also be interested in a pull request for this?

My first idea to fix this would be to keep a list of add-ons that have been disabled in this session by adding “else …” to this function. Then when generating the list of inactive add-ons for the “copy debug information” text I list add-ons as inactive only when addon.enabled is False and they are not in the “disabled this session” list.

I’m sure there are better implementations, any hint is welcome.

1 Like

I’d recommend you just set a global variable to True whenever an add-on is toggled on or off. If it’s true, the debug info could show a line like “Add-ons have been enabled or disabled since the last time Anki was restarted, and the list may not reflect the currently running add-ons”. You could also make the message at the top of the add-ons screen turn red to make it more obvious.