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] Increase the debounce timeout on search #6179

Closed
akhenry opened this issue Jan 25, 2023 · 4 comments · Fixed by #6259
Closed

[Search] Increase the debounce timeout on search #6179

akhenry opened this issue Jan 25, 2023 · 4 comments · Fixed by #6259

Comments

@akhenry
Copy link
Contributor

akhenry commented Jan 25, 2023

Is your feature request related to a problem? Please describe.
Search debounce is a little aggressive right now and results in multiple requests being fired off even when I am typing quite quickly. This results in a lot of unnecessary hits on back-end services, and slows down the UI.

eg.

Typing the word "notebook" into the search input results in a request for every single letter that I type in. Many of them are cancelled, however not all.

{selector: {model: {name: {$regex: "(?i)n"}}}}
{selector: {model: {name: {$regex: "(?i)no"}}}}
{selector: {model: {name: {$regex: "(?i)not"}}}}
{selector: {model: {name: {$regex: "(?i)note"}}}}

Describe the solution you'd like
We should debounce user input at a much slower rate than we currently are to reduce backend requests.

On this topic, I am curious about what happens when results arrive out of order (eg a search for n might take a lot longer to return than a search for notebook. Some investigation should be performed to ensure we are only ever showing the most recent search results.

@akhenry
Copy link
Contributor Author

akhenry commented Jan 25, 2023

Classifying as critical due to performance implications.

@scottbell scottbell linked a pull request Feb 2, 2023 that will close this issue
15 tasks
@scottbell
Copy link
Contributor

scottbell commented Feb 9, 2023

Testing Notes

This will need to be tested 3 ways: local, VPN, and on

Localstorage

  1. Create 15 Sinusoid generators with an incrementing name. i.e. "jamier0x_001" and "jamier0x_002"
  2. Create a display layout which uses this telemetry object name as "jamier0x"
  3. Refresh browser and wait for page to completely load.
  4. Type in "jamier0x" and verify that search results appear as intended and "spark joy"

VPN /testathon

Test 1

  1. Find a telemetry object with a long name. Copy to clipboard
  2. Refresh browser and wait for page to completely load.
  3. Paste Telemetry Name to search and verify that search results appear as intended and "spark joy"

Test 2

  1. Find a telemetry object with many similarly named telemetrypoints.
  2. Create a display layout which uses this telemetry object name exactly.
  3. Refresh browser and wait for page to completely load.
  4. Type in half of the telemetrypoint name and verify that search results appear as intended and "spark joy"

Test 3

  1. Bring up network panel and wait for page to load.
  2. Type quickly in search for an object you know exists
  3. Ensure only one network request for _find goes to CouchDB (not including a preflight request)

Lab Testing

@unlikelyzero will execute

@akhenry
Copy link
Contributor Author

akhenry commented Mar 9, 2023

Verified fixed. Can confirm that joy was sparked.

@akhenry akhenry removed the unverified label Mar 9, 2023
@akhenry
Copy link
Contributor Author

akhenry commented Mar 9, 2023

Found a separate issue with search and filed a followup - akhenry/openmct-yamcs#288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants