-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Make sure to handle the case when search results come back in a different order than retrieved #15479
Make sure to handle the case when search results come back in a different order than retrieved #15479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@nreese just curious if you tested this with IE 11 browser? |
@LeeDr I am mac only. No windows for me |
Me too, no IE 11 to test with. But it's not just IE11 we'd need to repro, I think you'd also need a setup that makes the fetches really slow, like how you had kibana running on a vm server separate from your client. That's why I tried to simulate the issue in code. Albiet not perfect. Any chance you can test this Lee with the same setup you used to repro originally? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution! I haven't tested in browser but the code looks good. Had one small suggestion.
this.setState({ | ||
isFetchingItems: false, | ||
selectedRowIds: [], | ||
filter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessary, is it? Can we remove it?
I probably won't get a chance to test this until after 6.1.0 ships (probably next week). But we shouldn't merge it into 6.1.0 now anyway. It could go into the 6.1 branch after 6.1.0 is released so it makes it into 6.1.1. I'm concerned that we're tweaking a timing parameter to try to get this to work. Someone will have a heavy load or a bit more latency and they'll see the same problem (unless the order is really the issue). Its the same reason we try to avoid using sleeps in the UI tests. If I understand the hypothesis of the problem, why would we send a second request for the first request has even returned? I guess it might appear more responsive, but if it's causing this ordering issue maybe it shouldn't make a request until the previous on has returned. |
Failed on #13163, been meaning to pull together a PR to skip that test... jenkins, test this |
Increasing the debounce doesn't fix this, the other logic does, so don't worry - I'm not relying on that and it shouldn't matter how long of a latency some requests take, or how heavy of a load, this should still work. I increased the debounced value only because it seemed 200ms was too slow if it was trigging per character input on your searches. It wasn't necessary for the fix.
I don't think this is the right solution because it could definitely slow responsiveness down a ton. The fix here should be sufficient. It will just ignore any earlier requests that come back, and only catch and save the most recent one that the user requested. |
abb2201
to
b30a6f8
Compare
…rent order than retrieved (elastic#15479) * Make sure to handle the rare case search results come back in a different order than retrieved * Remove unnecessary setting of filter on the state
Adding debounce should have alleviated the problem but apparently didn't actually fix it. (see #14909)
I also extended the debounce time a bit since that really should have made this pretty rare.
I was able to reproduce the error by adding this code to
visualize_listing.js
:to verify that this does fix the problem.