mozilla / addons

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

TypeError: filters.sort.split is not a function #13252

Closed willdurand closed 5 years ago

willdurand commented 5 years ago

https://sentry.prod.mozaws.net/operations/addons-frontend-amo-prod/issues/5946007/

TypeError: filters.sort.split is not a function
  File "/srv/code/src/amo/components/SearchFilters/index.js", line 173, in SearchFiltersBase.split [as render]
    .split(',')
  File "/srv/code/src/core/components/ServerHtml/index.js", line 206, in ServerHtml.renderToString [as render]
    const content = component ? ReactDOM.renderToString(component) : '';
  File "/srv/code/src/core/server/base.js", line 116, in renderToString
    return ReactDOM.renderToString(
  File "/srv/code/src/core/server/base.js", line 410, in renderHTML
    renderHTML({ props, pageProps, store });
  File "/srv/code/src/core/server/base.js", line 152, in asyncGeneratorStep
    .status(componentDeclaredStatus)
...
(120 additional frame(s) were not displayed)

TypeError: filters.sort.split is not a function

/cc @bobsilverberg

For QA: This can be reproduced by specifying two sort URL parameters for the search page, e.g., https://addons.mozilla.org/en-US/firefox/search/?sort=hotness&sort=users.

bobsilverberg commented 5 years ago

Thanks @willdurand, I'll take a look.

AlexandraMoga commented 5 years ago

Verified fixed on -dev. The following links are no longer throwing 500 errors. Search results will take in account only the first sort parameter.

  1. https://addons-dev.allizom.org/en-US/firefox/search/?sort=rating&sort=updated&type=extension
  2. https://addons-dev.allizom.org/en-US/firefox/search/?category=alerts-updates&sort=users&sort=rating&type=extension
  3. https://addons-dev.allizom.org/en-US/firefox/search/?category=holiday&sort=recommended%2Cusers&sort=updated&type=statictheme