Closed Bug 436974 Opened 18 years ago Closed 18 years ago

Add support for querying by os and app version to recommended call.

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: laura, Assigned: laura)

Details

Attachments

(1 file, 2 obsolete files)

Split off from bug 419057.
Target Milestone: 3.4.4 → 3.4.5
Attachment #328446 - Flags: review?(fwenzel)
Attachment #328446 - Flags: review?(morgamic)
Comment on attachment 328446 [details] [diff] [review] Adds support for version and platform to reco list Could you verify that choosing an app version in a range (i.e. appVersion = 3.0a1 which is > 2.0 but < 3.0.*) works? I got mixed results for a Linux-only add-on that had a 2.0->3.0b2 compatibility range when I set the appVersion to 3.0a1.
Attachment #328446 - Flags: review?(morgamic) → review-
It was add-on 2109
Comment on attachment 328446 [details] [diff] [review] Adds support for version and platform to reco list Since I don't think the URL format was documented anywhere, I tried to figure it out and with the following path...: /en-US/firefox/api/list/recommended/all/3/linux I receive a bunch of errors: Notice: Undefined variable: platform_id in /Users/fred/dev/addons/site/app/controllers/api_controller.php on line 314 Query: SELECT f.addon_id FROM features as f LEFT JOIN addons as a on f.addon_id = a.id WHERE f.start < NOW() AND f.end > NOW() AND f.application_id = '1' AND (f.locale = 'en-US' OR f.locale IS NULL) AND a.status = '4' UNION SELECT DISTINCT(f.addon_id) FROM addons_tags AS f LEFT JOIN addons AS a ON f.addon_id = a.id JOIN versions AS v ON v.addon_id = f.addon_id INNER JOIN files ON files.platform_id = AND v.id = files.version_id WHERE f.feature = 1 AND a.status ='4' Warning: SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND v.id = files.version_id WHERE f.feature = 1 AND a.s' at line 15 in /Users/fred/dev/addons/site/cake/libs/model/datasources/dbo_source.php on line 440 Apparently, it doesn't handle invalid platforms gracefully.
Attachment #328446 - Flags: review?(fwenzel) → review-
Target Milestone: 3.4.5 → 3.4.6
Attached patch revised patch (obsolete) — — Splinter Review
Rewrote version comparison stuff so it works right. I think. (</headache>) Added some error handling code for wenzel's issue.
Attachment #328446 - Attachment is obsolete: true
Attachment #330895 - Flags: review?(fwenzel)
Comment on attachment 330895 [details] [diff] [review] revised patch Sorry, but the path from comment 4 still errors out: Notice: Undefined variable: versions_criteria in /Users/fred/dev/addons/site/app/controllers/api_controller.php on line 338 Warning: Cannot modify header information - headers already sent by (output started at /Users/fred/dev/addons/site/app/controllers/api_controller.php:338) in /Users/fred/dev/addons/site/app/app_controller.php on line 283 (...)
Attachment #330895 - Flags: review?(fwenzel) → review-
Other than that, I seem to be getting results back, though, by the way.
I fixed the bug, then fixed the version checking and introduced a regression that brought back the bug. This revised revised patch fixes the regression as well.
Attachment #330895 - Attachment is obsolete: true
Attachment #330948 - Flags: review?(fwenzel)
Something still doesn't seem to be quite right: Why is Mouse Gestures returned when I query for: /en-US/firefox/api/list/recommended/all/5/bogus/0.3 ... as it doesn't "support" Firefox 0.3 in the first place, but when I write "WINNT" instead of "bogus", the result is empty? Also, it'd be quite helpful if you added the new paramters to the "Javadoc-like" documentation of the method. For possible API users: How do they find out which platform IDs are valid? I didn't know they were case sensitive ("linux" won't work), for example, and stuff like "WINNT" is not the most intuitive either.
Comment on attachment 330948 [details] [diff] [review] revised revised patch All right, "bogus" turns into "all" by default, and as it turns out, Mouse Gestures explicitly supports Fx 0.3, so returning it is "works as designed". The API doesn't show that compatibility range though, which is part of bug 342963. Please add some documentation, where you state that the platforms are case-sensitive. Now I am satisfied :) Good job!
Attachment #330948 - Flags: review?(fwenzel) → review+
Patch committed in r17290.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
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: