AtlasOfLivingAustralia / specieslist-webapp

Species lists and traits tool
https://lists.ala.org.au
Mozilla Public License 2.0
6 stars 21 forks source link

Lists returns different sets based on query parameter order #230

Closed sat01a closed 1 year ago

sat01a commented 1 year ago

This query returns an expected list of state and national conservation lists:

https://lists.ala.org.au/public/speciesLists?&max=25&sort=listName&order=asc&listType=eq:CONSERVATION_LIST&isThreatened=eq:true&isAuthoritative=eq:true

This query returns a weird mix of private lists and unwanted results:

https://lists.ala.org.au/public/speciesLists?&max=25&sort=listName&order=asc&isAuthoritative=eq:true=&isThreatened=eq:true&listType=eq:CONSERVATION_LIST

The only difference seems to be the order of parameters. This means that clicking the flags on the lists tool returns unexpected results.

sat01a commented 1 year ago

Added to the board - (cc @peggynewman )

sughics commented 1 year ago

This does not necessarily seem to be an issue with the parameter order - in the second request, the there is an additional misplaced= within &isAuthoritative=eq:true= which is causing the results to be different. When this character is removed, both of the URLs listed above return the same values in the same order regardless of the url parameter order.

Looking at the lists UI, some filters are still available to select after they have already been selected. If selected again, a duplicate param is added to the url - returning incorrect results and eventually result in a 400 error. The misplaced = mentioned earlier might have been an artefact of the issue described above.

Image

sughics commented 1 year ago

Also related to https://github.com/AtlasOfLivingAustralia/specieslist-webapp/issues/232

peggynewman commented 1 year ago

Cheers @sughics, I do recall finding the isAuthoritative flag showing up twice, so I think you're right about selecting the filters twice being weird.

sughics commented 1 year ago

Duplicate facet removal fix implemented here: https://github.com/AtlasOfLivingAustralia/specieslist-webapp/pull/233

sughics commented 1 year ago

Cheers @sughics, I do recall finding the isAuthoritative flag showing up twice, so I think you're right about selecting the filters twice being weird.

Turns out the logic behind displaying the unchekced tag facets i.e. boolean facets (isAuthoritative, isThreatened, isInvasive, isSDS, isBIE, isPrivate, and wkt) did not check to determine whether they were already selected - resulting in unchecked facets always being displayed. The fix above should address this.