We changed the API version and this requires users to update the addon.
When this happens, the add-on should show a message that it need to be update.
However, it shows an error message instead.
We were expecting this to be true for the response (on the client-side):
response.reason="Outdated client, please update the AnkiHub add-on."
This works locally, but when communicating with the production server response.reason doesn't contain the custom message, instead it contains the default reason for responses with the status code 406 (Not Allowed).
To fix this, we will now return the message in the content of the response instead of in the reason and the client will be adjusted accordingly.
Related web app PR: https://github.com/AnkiHubSoftware/ankihub/pull/2411
Related issues
https://ankihub.atlassian.net/jira/software/c/projects/BUILD/boards/1?selectedIssue=BUILD-773 Sentry: https://ankihub.sentry.io/issues/5458237219/?project=6546414&query=is%3Aunresolved%20406&referrer=issue-stream&statsPeriod=7d&stream_index=0 Discourse: https://community.ankihub.net/t/406-error-master-thread/335342
Proposed changes
We were expecting this to be true for the response (on the client-side):
This works locally, but when communicating with the production server
response.reason
doesn't contain the custom message, instead it contains the default reason for responses with the status code 406 (Not Allowed
).To fix this, we will now return the message in the content of the response instead of in the reason and the client will be adjusted accordingly.
How to reproduce
18.0
here: https://github.com/AnkiHubSoftware/ankihub_addon/blob/dcfa06dbfc1cec370e3d0f30a9bd9d09afd66f3a/ankihub/ankihub_client/ankihub_client.py#L77Try the same thing with the api version set to
19.0
. In this case the deck management dialog should open as usual.