Closed Bug 758052 Opened 12 years ago Closed 10 years ago

API search shouldn't return add-ons with binary components when compat mode is set to "normal"

Categories

(addons.mozilla.org Graveyard :: API, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: krupa.mozbugs, Unassigned)

References

()

Details

Attachments

(1 file)

Attached image screenshot
steps to reproduce:
1. Load https://addons-dev.allizom.org/en-US/firefox/api/1.5/search/last%20pa/all/30/Darwin/15.0a1/normal?src=firefox
2. Notice that 'LastPass Password Manager' is listed among the search results

expected behavior:
version 1.80.0 of LastPass Password Manager has binary components and shouldn't be listed as compatible.

We should probably list version 1.74 which looks compatible with Firefox 15

actual behavior:
We are listing add-on version which has binary components when compat mode is set to "normal".

AMO correctly shows this add-on as incompatible: https://addons-dev.allizom.org/en-US/firefox/addon/lastpass-password-manager/?src=search
Target Milestone: --- → 2012-05-31
I'm pretty sure what's happening here is this...

The query is trying to find a version with files that doesn't use binary components.

The latest version does:
mysql> select id, filename, strict_compatibility, binary_components from files where version_id=1323306;
+--------+-------------------------------------------------------+----------------------+-------------------+
| id     | filename                                              | strict_compatibility | binary_components |
+--------+-------------------------------------------------------+----------------------+-------------------+
| 146718 | lastpass_password_manager-1.90.6-sm+fn+fx-windows.xpi |                    0 |                 1 |
| 146719 | lastpass_password_manager-1.90.6-sm+fn+fx-android.xpi |                    0 |                 1 |
| 146720 | lastpass_password_manager-1.90.6-sm+fn+fx-maemo.xpi   |                    0 |                 1 |
| 146722 | lastpass_password_manager-1.90.6-sm+fn+fx-linux.xpi   |                    0 |                 1 |
| 146723 | lastpass_password_manager-1.90.6-sm+fn+fx-mac.xpi     |                    0 |                 1 |
+--------+-------------------------------------------------------+----------------------+-------------------+

And this is true for each version until it hits version 1.80.0...

mysql> select id, filename, strict_compatibility, binary_components from files where version_id=1289052;
+--------+-------------------------------------------------------+----------------------+-------------------+
| id     | filename                                              | strict_compatibility | binary_components |
+--------+-------------------------------------------------------+----------------------+-------------------+
| 136367 | lastpass_password_manager-1.80.0-sm+fn+fx-linux.xpi   |                    0 |                 0 |
| 136369 | lastpass_password_manager-1.80.0-sm+fn+fx-mac.xpi     |                    0 |                 0 |
| 136370 | lastpass_password_manager-1.80.0-sm+fn+fx-windows.xpi |                    0 |                 1 |
| 136371 | lastpass_password_manager-1.80.0-sm+fn+fx-android.xpi |                    0 |                 0 |
| 136373 | lastpass_password_manager-1.80.0-sm+fn+fx-maemo.xpi   |                    0 |                 1 |
+--------+-------------------------------------------------------+----------------------+-------------------+

The way we are JOINing on files and asking if they users binary_components I suspect is returning true when any record matches the binary_compat check and then we think this version is ok.

For example:

mysql> SELECT versions.id, versions.version, files.filename FROM versions INNER JOIN files ON files.version_id = versions.id WHERE versions.id=1289052 and files.binary_components=1;
+---------+---------+-------------------------------------------------------+
| id      | version | filename                                              |
+---------+---------+-------------------------------------------------------+
| 1289052 | 1.80.0  | lastpass_password_manager-1.80.0-sm+fn+fx-windows.xpi |
| 1289052 | 1.80.0  | lastpass_password_manager-1.80.0-sm+fn+fx-maemo.xpi   |
+---------+---------+-------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> SELECT versions.id, versions.version, files.filename FROM versions INNER JOIN files ON files.version_id = versions.id WHERE versions.id=1289052 and files.binary_components=0;
+---------+---------+-------------------------------------------------------+
| id      | version | filename                                              |
+---------+---------+-------------------------------------------------------+
| 1289052 | 1.80.0  | lastpass_password_manager-1.80.0-sm+fn+fx-linux.xpi   |
| 1289052 | 1.80.0  | lastpass_password_manager-1.80.0-sm+fn+fx-mac.xpi     |
| 1289052 | 1.80.0  | lastpass_password_manager-1.80.0-sm+fn+fx-android.xpi |
+---------+---------+-------------------------------------------------------+
3 rows in set (0.00 sec)

In this last one, there are 3 files in this version where binary components aren't being used, so we're assuming this one is good when we should be assuming the opposite because there are 2 that *do* use binary components and, at least for now, we're not differentiating between platforms for d2c.

I may need help with the SQL to fix this.
https://github.com/mozilla/zamboni/commit/7cdff1d

Now including platform in the parameters to determine default-to-compatible versions.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
For some reason, LastPass.. is still listed in the API search. Trying with a brand new add-on which has platform-specific file seemed to work. My test add-on didn't have multiple versions though.

Rob is looking into it.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 2012-05-31 → ---
Assignee: robhudson.mozbugs → nobody
Thanks for filing this.  Due to resource constraints we are closing bugs which we won't realistically be able to fix.  If you have a patch that applies to this bug please reopen.

For more info see http://micropipes.com/blog/2014/09/24/the-great-add-on-bug-triage/
Status: REOPENED → RESOLVED
Closed: 12 years ago10 years ago
Resolution: --- → WONTFIX
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: