You may or may not get the correct add-on file for your platform when you click the install button.
Depending on what platform you're on (Linux, Windows, Mac OS X) you should always get the right add-on file during installation.
Here are some real world cases that might trigger this issue:
You can take a look at the API representation of the example add-on with:
curl https://addons-dev.allizom.org/api/v3/addons/addon/ratopuse-weasp-vulturkal/
This is what the files array looks like:
"files" : [
{
"is_restart_required" : false,
"id" : 253517,
"size" : 4162,
"is_webextension" : true,
"permissions" : [],
"platform" : "linux",
"created" : "2017-08-24T14:47:04Z",
"status" : "public",
"hash" : "sha256:638e8aa4fc91e58cb003f163b1e129b362aa991a0460bcf9101daff7f8a4b653",
"url" : "https://addons-dev.allizom.org/firefox/downloads/file/253517/ratopuse_weasp_vulturkal-1.0-an+fx-linux.xpi?src="
},
{
"is_restart_required" : false,
"id" : 253518,
"is_webextension" : true,
"size" : 4161,
"platform" : "mac",
"permissions" : [],
"status" : "public",
"created" : "2017-08-24T14:48:26Z",
"url" : "https://addons-dev.allizom.org/firefox/downloads/file/253518/ratopuse_weasp_vulturkal-1.0-an+fx-mac.xpi?src=",
"hash" : "sha256:2755819195584b4e7693ea5d08493b476fb9318b0f2e6560d29e5877cb64dfd5"
},
{
"size" : 4162,
"is_webextension" : true,
"id" : 253519,
"is_restart_required" : false,
"hash" : "sha256:749b0183848611335c7ff10ce0a2aa25cddcaf07b7bd565ba046769252de8db5",
"url" : "https://addons-dev.allizom.org/firefox/downloads/file/253519/ratopuse_weasp_vulturkal-1.0-an+fx-windows.xpi?src=",
"created" : "2017-08-24T14:48:26Z",
"status" : "public",
"permissions" : [],
"platform" : "windows"
},
{
"platform" : "android",
"permissions" : [],
"status" : "public",
"created" : "2017-08-24T14:48:41Z",
"url" : "https://addons-dev.allizom.org/firefox/downloads/file/253520/ratopuse_weasp_vulturkal-1.0-an+fx-android.xpi?src=",
"hash" : "sha256:f7aba3eeadafbf2203972595f2cb10777a6d9967bcd76ba9aaa5142be0df4b68",
"is_restart_required" : false,
"id" : 253520,
"size" : 4162,
"is_webextension" : true
}
]
We definitely do a lot of addon.current_version.files[0] checks throughout the app. Sounds like this could bite us elsewhere, though in other places that might just be surfacing mismatched information.
The reducers could change files from an array to a platform-indexed object... or I guess we just need a getFileForPlatform utility that would pick either a platform's add-on or an "ALL" platform.
Using the mentioned example (https://addons-dev.allizom.org/en-US/firefox/addon/ratopuse-weasp-vulturkal/), I've tried to install it on Win 7, Mac OS 10.13 and Ubuntu 16.04 using FF58 and AMO-dev.
Installing the extension on first two OS's worked as expected.
Details page of the extensions, on Ubuntu 16.04, lists the red banner "This add-on is not available on your platform." - @kumar303 , what do you think?
Reopening this until further notice.
Can you please attach the user agent string for the browser that didn鈥檛 work? That should help us test things :-)
The user agent that was used while testing above scenario on Linux was:
I've tried now the latest version of Nightly on Linux, and the red banner is no longer displayed. User agent for this version is:
Thanks for the user agent strings. I can reproduce this and I am working on a fix.
I added support for as many mainstream Linux/Unix flavors as I could think of. I did not add support for historical OSes like RISC, etc.
Verified this as fixed on Ubuntu 16.04 using FF57 and things seem to work as expected.
Postfix screenshots:


Most helpful comment
I added support for as many mainstream Linux/Unix flavors as I could think of. I did not add support for historical OSes like RISC, etc.