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

[Search UI] breaks when user makes simple URL modifications #1003

Open
fvanderwielen opened this issue Nov 2, 2023 · 11 comments
Open

[Search UI] breaks when user makes simple URL modifications #1003

fvanderwielen opened this issue Nov 2, 2023 · 11 comments
Labels
bug Something isn't working enhancement epic:search-ui Search UI related updates team:search-experiences

Comments

@fvanderwielen
Copy link

fvanderwielen commented Nov 2, 2023

Describe the bug
With the default setup, the SDK breaks when the user modifies the URL to something that does not exactly match the format of the requestState object

To Reproduce
Steps to reproduce the behavior:
reproducible currently in the demo codesandbox environment here: https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox?from-embed=&initialpath=/elasticsearch&file=/src/pages/elasticsearch/index.js

  1. Go to https://32xp9i.csb.app/elasticsearch?size=n_20_n&filters[asdfasdfasdf]
  2. See error on the entire page: "An unexpected error occurred: (intermediate value).filter is not a function"

Expected behavior
A more robust error handling, for example defaulting filters to an empty array when wrong typing is found.

Screenshots
image

Which backends and packages are you using:
Packages: [search-ui]

Additional info
What happens is that parseing of the URL is not robust, there is only a non-falsy check but that is not enough, as other SDK code assumes that the requestState properties actually have correct type.

Parsing is not robust here:

function paramsToState(queryParams: QueryParams): RequestState {

This SDK code here assumes filters to be an array (as it assumes filters.filter to be a function), which is is not in the reproduction scenario, and no safeguards exist against this:
const updatedFilters = filters.filter((filter) => {

@fvanderwielen fvanderwielen added the bug Something isn't working label Nov 2, 2023
@botelastic
Copy link

botelastic bot commented Jan 1, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.

@botelastic botelastic bot added the wontfix This will not be worked on label Jan 1, 2024
@fvanderwielen
Copy link
Author

I still think this bugfix is important, it makes the SDK less brittle against what is from my perspective realistic user behavior.

@botelastic botelastic bot removed the wontfix This will not be worked on label Jan 8, 2024
@joemcelroy
Copy link
Member

thanks for reporting the issue. Will add it to list of improvements

@maxjakob maxjakob changed the title search-ui breaks when user makes simple URL modifications [Search UI] breaks when user makes simple URL modifications Feb 9, 2024
@serenachou serenachou added the epic:search-ui Search UI related updates label Feb 20, 2024
@botelastic
Copy link

botelastic bot commented Apr 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.

@botelastic botelastic bot added the wontfix This will not be worked on label Apr 20, 2024
@fvanderwielen
Copy link
Author

still think so, also getting a bit tired of the configuration of the issue bot...

@botelastic botelastic bot removed the wontfix This will not be worked on label Apr 22, 2024
@botelastic
Copy link

botelastic bot commented Aug 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.

@botelastic botelastic bot added the wontfix This will not be worked on label Aug 17, 2024
@fvanderwielen
Copy link
Author

still think so, also getting quite a bit more tired of the configuration of the issue bot...

@botelastic botelastic bot removed the wontfix This will not be worked on label Aug 19, 2024
@botelastic
Copy link

botelastic bot commented Oct 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.

@botelastic botelastic bot added the wontfix This will not be worked on label Oct 18, 2024
@fvanderwielen
Copy link
Author

#1003 (comment)

@botelastic botelastic bot removed the wontfix This will not be worked on label Oct 18, 2024
@botelastic
Copy link

botelastic bot commented Dec 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.

@botelastic botelastic bot added the wontfix This will not be worked on label Dec 17, 2024
@fvanderwielen
Copy link
Author

justintimberlakestare.gif

@botelastic botelastic bot removed the wontfix This will not be worked on label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement epic:search-ui Search UI related updates team:search-experiences
Projects
None yet
Development

No branches or pull requests

5 participants