Skip to content

New API only returns a single icon #5255

Closed
mozilla/addons-server
#7572

Description

@aswan

Describe the problem and steps to reproduce it:

(Please include as many details as possible.)

What happened?

Searched for addon details with the new search API, the result includes a single icon_url property.

What did you expect to happen?

The old search API returned a list of icons, that looked something like

<icon size="32">https://addons.cdn.mozilla.net/user-media/addon_icons/blah32.png</icon>
<icon size="64">https://addons.cdn.mozilla.net/user-media/addon_icons/blah64.png</icon>

I expected the new API to also include all the available icons.

Anything else we should know?

(Please include a link to the page, screenshots and any relevant files.)

Activity

  1. diox commented on Feb 7, 2018

    @diox
    Member

    64 pixels should be enough for everyone!

    Yeah, not sure what I was thinking when I wrote it. We currently generate a bunch of sizes: 32, 48, 64, 128, 256, 512. I'm not sure if we need all that... Also, changing this without breaking existing clients is going to be annoying.

  2. eviljeff commented on Feb 8, 2018

    @eviljeff
    Member

    good thing the v3 is still "experimental" 😆 - we just need addons-frontend to support both a single icon and a size:path dict first. I'll log an issue.

  3. diox commented on Feb 15, 2018

    @diox
    Member

    32, 48, 64 appear to be the only sizes that are actually working, at least for the add-ons I'm testing with. Since the legacy API was returning only 32 and 64, I suggest that the v3 API only return those 2 sizes as well, and we can figure out what to do about the other sizes afterwards.

  4. diox commented on Feb 15, 2018

    @diox
    Member

    I think we can add a new icons field to the response, and not touch the icon one. We'd eventually drop icon entirely, but that enables us to implement it without waiting for the frontend.

    So, it would look like this:

    "icons": {
      "32": "https://addons.cdn.mozilla.net/user-media/addon_icons/1/1865-32.png?modified=1516707961",
      "64": "https://addons.cdn.mozilla.net/user-media/addon_icons/1/1865-64.png?modified=1516707961"
    }
    
  5. self-assigned this
    on Feb 15, 2018
  6. eviljeff commented on Feb 15, 2018

    @eviljeff
    Member

    Yeah, agreed on icons - it's accurately named too.

    I found from testing yesterday that all the icon sizes were generated when i selected a new icon for an existing listing. I don't know how long that's been true for though.

  7. diox commented on Feb 15, 2018

    @diox
    Member

    My guess is that it has been the case for a while, but not applied retroactively to old add-addons... I was testing with adblock-plus, which is quite old. Since for our immediate needs 64 is the biggest we'll need, it's fine.

  8. eviljeff commented on Feb 15, 2018

    @eviljeff
    Member

    Yes, and we don't really want to upscale all the existing 64x64 icons to 512.

    Really the feature is broken - we say 64 is the max in devhub (so that's probably the max size uploaded by a Dev); then resize them anyway. It's quite likely all the icons at 128, 256, 512 are useless therefore -we should probably just delete them.

  9. diox commented on Feb 15, 2018

    @diox
    Member

    I agree. Moving this discussion to #4510 :)

  10. AlexandraMoga commented on Feb 16, 2018

    @AlexandraMoga

    Verifed on AMO dev, with FF58, Win10x64

    Checked with the following add-on and the new icons property is returned; the old icon_url property is also present:

    https://addons-dev.allizom.org/api/v3/addons/addon/adblock-plus-test/
    
    

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions