Firefox should define a value for extensions.getAddons.recommended.url so AddonRepoistory.retrieveRecommendedAddons() works

RESOLVED FIXED in mozilla23

Status

()

Toolkit
Add-ons Manager
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: sheppy, Assigned: sachin)

Tracking

({regression})

Trunk
mozilla23
regression
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
I don't have a value set for this preference, so the AddonRepository.jsm API fails immediately instead of attempting to load recommendations when I call retrieveRecommendedAddons(). If this pref is missing, an appropriate default should be used.
(Reporter)

Comment 1

6 years ago
Looks like no default is set for this preference on a fresh install of Firefox. Setting the preference to:

https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox

Makes the API start to work.
Not going to be a blocker but we should probably re-add the preference back so the API continues to work.
Dave, do we make use of the URL in any of our UI? Or is it a method which can be used by add-ons?
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
(In reply to comment #3)
> Dave, do we make use of the URL in any of our UI? Or is it a method which can
> be used by add-ons?

We don't use it in the UI anymore but the API is still available for add-ons.
Regression from bug 554007.
Blocks: 554007
Keywords: regression
Whiteboard: [good first bug]
Blocks: 629398
No longer blocks: 629398
(Assignee)

Comment 6

4 years ago
Created attachment 737093 [details] [diff] [review]
If the preference doesn't exist, it uses the default value.

No preference was created, though.
Please tell me where the other preferences are created, if I have to create a preference for this.
Attachment #737093 - Flags: review?(eshepherd)
Comment on attachment 737093 [details] [diff] [review]
If the preference doesn't exist, it uses the default value.

Review of attachment 737093 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for jumping in to fix this, Sachin. Sorry for the confusion here - we don't support default preferences for URLs in the code (ie, AddonRepository.jsm shouldn't be modified to support this). As comment 2 says, all we need is a value for this preference added here:
http://mxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#44

Other apps will have to set the value for the pref if they want to have that API be usable, same as every other URL the Add-ons Manager uses.
Attachment #737093 - Flags: review?(eshepherd) → review-
(Assignee)

Comment 8

4 years ago
Created attachment 737225 [details] [diff] [review]
Creates the preference with a default value.

Thanks Blair, for the review.
Assignee: nobody → sachinhosmani2
Attachment #737093 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #737225 - Flags: review?(bmcbride)
Comment on attachment 737225 [details] [diff] [review]
Creates the preference with a default value.

Review of attachment 737225 [details] [diff] [review]:
-----------------------------------------------------------------

Wonderful, thanks :)
Attachment #737225 - Flags: review?(bmcbride) → review+
Summary: If extensions.getAddons.recommended.url pref doesn't exist, use a reasonable default → Firefox should define a value for extensions.getAddons.recommended.url so AddonRepoistory.retrieveRecommendedAddons() works
Landed on the fx-team branch, which should get merged into mozilla-central within a day or two:

https://hg.mozilla.org/integration/fx-team/rev/00c7171cf12c
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/00c7171cf12c
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.