Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty filter params from Finder Frontend #346

Closed
wants to merge 1 commit into from

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Nov 7, 2024

Finder Frontend's buggy filter query construction logic will send through empty query params for part_of_taxonomy_tree whenever a finder has a taxon facet and none have been selected by the user. This is difficult to fix upstream, and other clients may misbehave similarly in the future.

This would otherwise be "fine", but when running behind an AWS API Gateway, these empty params are transformed from
part_of_taxonomy_tree[] to part_of_taxonomy_tree[]=, causing Search API v2's Rails app to parse them as an empty string rather than nil, and we end up filtering for empty strings as taxon IDs (which matches no documents).

  • Remove blank filter params using a present? check as part of filter parsing

Finder Frontend's buggy filter query construction logic will send
through empty query params for `part_of_taxonomy_tree` whenever a finder
has a taxon facet and none have been selected by the user. This is
difficult to fix upstream, and other clients may misbehave similarly in
the future.

This would otherwise be "fine", but when running behind an AWS API
Gateway, these empty params are transformed from
`part_of_taxonomy_tree[]` to `part_of_taxonomy_tree[]=`, causing Search
API v2's Rails app to parse them as an empty string rather than nil, and
we end up filtering for empty strings as taxon IDs (which matches no
documents).

- Remove blank filter params using a `present?` check as part of filter
  parsing
@csutter
Copy link
Contributor Author

csutter commented Nov 27, 2024

Not needed as we're not going to make this public for now.

@csutter csutter closed this Nov 27, 2024
@csutter csutter deleted the param-parsing-improve branch November 27, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant