-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[#60649] Change op-autocompleter debounce to 250ms #17646
base: release/15.2
Are you sure you want to change the base?
Conversation
Increases the debounce to a more typical value (200-300ms) for a complex web application. The current value (50ms) results in a large number of unnecessary API requests - on installatons with large numbers of work packages, this can lead to severe performance degradation. This partially reverts a change made in commit b0fffbc Signed-off-by: Alexander Brandon Coles <[email protected]>
c13b2f2
to
b7cf586
Compare
Fixes `Type 'Timer' is not assignable to type 'number' error when running `npm run test:watch`. node typings for `setInterval()` specify `Timer` as its return type. This patch explicitly calls the browser variant, which returns `number`. See also TypeStrong/atom-typescript#1053
Implements a `debounceTimeMs` input property, allowing us to tweak the time in component subclasses and individual instances if need be. This also reverts the zero initial debounce (also introduced in commit b0fffbc).
if (this.initialDebounce) { | ||
this.initialDebounce = false; | ||
return 0; | ||
} |
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.
Removing the logic that disables the debounce on first user interaction - I don't think this behaviour makes sense (do we really want to make API calls for single letter query strings - in fact it would make more sense to me to only make requests when a minimum number of characters have been entered by the user)
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.
I vaguely remember that I added that to stabilize end-to-end tests. It was done in this commit: 9aa36e5
Sadly, I don't remember much of it and I did not add a lot of comments or information in the commit message.
OpAutocompleterComponent
, not just the work package relations autocompleterWorkPackageRelationsAutocompleteComponent
Ticket
https://community.openproject.org/wp/60649
What are you trying to accomplish?
Change op-autocompleter debounce to 250ms
Increases the debounce to a more typical value (200-300ms) for a complex web application. The current value (50ms)* results in a large number of unnecessary API requests - on installatons with large numbers of work packages, this can lead to severe performance degradation.
Screenshots
Screen.Recording.2025-01-17.at.13.17.08.mov
What approach did you choose and why?
Merge checklist