mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

Pass `app` to the Recommendations endpoint #14296

Closed willdurand closed 3 years ago

willdurand commented 3 years ago

Describe the problem and steps to reproduce it:

  1. Go to https://addons.mozilla.org/en-US/android/addon/ublock-origin/ with either Fenix or FF Desktop

What happened?

The URL pointing to the XPI contains "firefox" instead of "android".

What did you expect to happen?

The URL should always contain "android" because we fixed this bug in https://github.com/mozilla/addons/issues/8221 (see also https://github.com/mozilla/addons/issues/13975).

Anything else we should know?

This happens because we load recommendations (the card below the description card), which are not for "Android" but for "Firefox" (maybe because we don't pass app or something else). When loading the recommendations, we seem to update the addons state with the new data, thus updating the download URL.

This is reproducible with uBlock Origin because it is very likely to be recommended. It does not happen with all add-ons compatible with Fenix.

This issue is reproducible on all envs, and it breaks the nice install flow we have in Fenix (instead of opening the Add-ons Manager, it downloads the XPI).

willdurand commented 3 years ago

Looks like we can pass the app parameter to the Recommendations API endpoint (even if it isn't documented). Let's do this.

ioanarusiczki commented 3 years ago

@willdurand I reproduced the issue on prod with Search by Image and uBlock. I'll check this today, I'm on it

ioanarusiczki commented 3 years ago

@willdurand On production I could reproduce it like this:

on AMO stage:

The issue looks fixed to me.

ioanarusiczki commented 3 years ago

@willdurand I made several checks on production today, and found some issues again. I filed https://github.com/mozilla/addons-frontend/issues/10920