guardian / facia-scala-client

Low level client for the Facia JSON API
Other
2 stars 1 forks source link

fix: Items queries starting with 'search' will be wrongly-run as search queries #282

Closed OllysCoding closed 1 year ago

OllysCoding commented 1 year ago

Co-Authored-By: Ioanna Kokkini ioannakok@users.noreply.github.com

What does this change?

Switch from checking with 'startsWith' to checking a full equals of 'search' for the path. The previous 'startsWith' method was mis-classifying queries such as 'searchlight-pictures-the-banshees-of-inisherin', causing bugs for some backfilled containers.

Search queries look like: search?tag=...&stuff=...

The broken item queries are searchlight-pictures-the-banshees-of-inisherin

Because the item path becomes search in the first instance, and stays as searchlight-pictures-the-banshees-of-inisherin in the second, using .startsWith was capture both instances. This PR fixes that

How to test

We've added a test to cover this case for the future

Have we considered potential risks?

We checked the full fronts tool config file, all the cases of using the search?... parameter would still work, and the remaining are the 'searchlight' type backfills which are currently broken

Deployment