thunderbird / addons-server

🕶 addons.thunderbird.net Django app and API, forked from addons.mozilla.org 🎉
https://addons.thunderbird.net
BSD 3-Clause "New" or "Revised" License
18 stars 17 forks source link

Enforce Strict Compatibility on experiment file uploads #172

Open jobisoft opened 3 years ago

jobisoft commented 3 years ago

This is what TB91 requests after the upgrade from TB78, when Philipps google provider add-on was installed:

https://services.addons.thunderbird.net/api/v3/addons/search/?guid=%7Ba62ef8ec-5fdc-40c2-873c-223b8a6925cc%7D%2Cgoogle%40search.mozilla.org%2Camazondotcom%40search.mozilla.org%2Cbing%40search.mozilla.org%2Cddg%40search.mozilla.org%2Cwikipedia%40search.mozilla.org%2Cdefault-theme%40mozilla.org%2Cthunderbird-compact-dark%40mozilla.org%2Cthunderbird-compact-light%40mozilla.org&lang=en-US

This reported:

grafik

But that is not what is actually stored in ATN:

grafik

Hoping it is a caching issue. Reported it nevertheless.

jobisoft commented 3 years ago

The version information was updated in the ATN profile after the upload. I assume the "current version" information is only changed when a version is actually uploaded.

jobisoft commented 3 years ago

If we can change to have that query always return current data and not the information cached from when the last version was uploaded, I would like to propose to also adapt how app and appversion on the query are used.

From what I can see, it is just a filter on the (cached) current_version compatibility values:

Query for Quicktext for TB91 (which happens to be the most recent upload and thus returned by current_version): https://services.addons.thunderbird.net/api/v4/addons/search/?guid={8845E3B3-E8FB-40E2-95E9-EC40294818C4}&app=thunderbird&appversion=91.0

Query for Quicktext for TB78: https://services.addons.thunderbird.net/api/v4/addons/search/?guid={8845E3B3-E8FB-40E2-95E9-EC40294818C4}&app=thunderbird&appversion=78.0

The second query comes back empty. However, it should return the last version compatible with TB78. From the description of the API I do not get the impression, that search only works on the most recent uploads:

https://addons-server.readthedocs.io/en/latest/topics/api/v4_frozen/addons.html

This can of course be moved into a dedicated issue.

jobisoft commented 3 years ago

The description of the addon endpoint reads:

Make current_version return the latest public version of the add-on compatible with the given application version, if possible, otherwise fall back on the generic implementation. Pass the full version as a string, e.g. 46.0. Only valid when the app parameter is also present. Currently only compatible with language packs through the add-on detail API, ignored for other types of add-ons and APIs.

That would contradict my last comment. The generic implementation used by the search endpoint is indeed designed to look at the most recent uploads only. Not helpful. And even for the addon endpoint, it only works for language packs, not for extensions.

Sancus commented 3 years ago

This specific instance is fixed but we should change things so that strict compatibility is enforced on experiments, as they are prone to getting broken when people don't set a strict_max_version in the manifest.json.