internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.01k stars 1.27k forks source link

Filters from the same category dissappear #8994

Open raffchen opened 4 months ago

raffchen commented 4 months ago

Problem

Evidence / Screenshot

If we have more than one filter from the same category on a search like so: image

And then we add a filter from a different category using the side menu, then only the one that was added last stays: image

Adding the filters by manually editing the URL still works: image

Relevant URL(s)

https://openlibrary.org/search?q=fantasy&mode=everything&subject_facet=Fiction&subject_facet=Fiction%2C+fantasy%2C+general&subject_facet=Fantasy

Reproducing the bug

  1. Search for a book and apply multiple filters from the same category, or go to https://openlibrary.org/search?q=fantasy&mode=everything&subject_facet=Fiction&subject_facet=Fiction%2C+fantasy%2C+general&subject_facet=Fantasy
  2. Using the side menu, add a filter from a different category, such as Language or Author

Context

Notes from this Issue's Lead

Proposal & constraints

Related files

Stakeholders

raffchen commented 4 months ago

After doing some digging, it looks like this is because of webpy's storify function. This is used in webpy's input function which we use in changequery.

https://github.com/webpy/webpy/blob/d3649322b85777b291ac2b7b3699fb6fc839e382/web/utils.py#L130-L141 image

For my example URL from above, this is the result: image

raffchen commented 4 months ago

I've linked a draft fix for this that seems to work.