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

SearchKit - Prevent race conditions in search display loading #21394

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Sep 7, 2021

Overview

Fixes some oddities when reloading results in a Search display after typing into a filter field.

Before

Depending on how fast or slow you type, the wrong results may be shown in the table or the pager.

After

Correct results always shown.

Technical Details

The problem was race conditions where typing into a filter field would trigger multiple requests per second. This fix:

  • Increases debounce timeout from 100 to 800 ms
  • Internally tracks the requests to ensure that later requests always take priority

- Increases debounce timeout from 100 to 800 ms
- Internally tracks the requests to ensure that later requests always take priority
@civibot
Copy link

civibot bot commented Sep 7, 2021

(Standard links)

@civibot civibot bot added the master label Sep 7, 2021
@eileenmcnaughton
Copy link
Contributor

I'm not sure I types fast enough to replicate this - but nothing seems to be broken by it in my testing

@eileenmcnaughton eileenmcnaughton merged commit d83e22b into civicrm:master Sep 8, 2021
@eileenmcnaughton eileenmcnaughton deleted the debounceGetResults branch September 8, 2021 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants