Make sure to return from original link handler to preserve Python → JS bridge #130
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.
Hi ospalh,
I've been trying to resolve common add-on conflicts recently, and one of the key issues I've found were problems with the implementation of link handler patches. The crux is that in Anki 2.1, the link handler no longer only acts as a one-way street between JS and Python, but can also pass return values from Python to JS via an optional
pycmd
callback (cf. ankitects/anki#228 and ankitects/anki@56e1643).Unfortunately this is not as obvious in Anki's source code as it probably should be (something I plan to file a PR for), and expectedly many add-ons do not return from their custom link handlers. As a result they interfere with other add-ons that do depend on this Python → JS bridge (e.g. Pop-up Dictionary).
So what I'm trying to do at the moment is to go through the add-ons in question and either file PRs to fix the problem, or notify the authors about the situation. Since I likely won't be able to catch all cases, I'd very much appreciate it if you could check and see if you can find any other add-ons that have the same problem.
Thanks a lot in advance!