-
Notifications
You must be signed in to change notification settings - Fork 435
fix: Reduce frequency of identity search requests in frontend #5379
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@Keerthi421 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
Uffizzi Ephemeral Environment
|
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.
Thanks for the contribution! It's working really well.
While I was comparing with using debounce. I realized the custom implementation we have of useThrottle
in useSearchThrottle
is actually more of a debounce
one.
I'm approving as of because it's great but if ever in bonus you feel like renaming useThrottle
into useDebounce
and useSearchThrottle
into useDebouncedSearch
that'd be awesome
@Zaimwa9 Sure , I will change |
@Zaimwa9 , I have made changes please review it |
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.
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.
Thanks again. One last back and forth as it doesn't build as of.
> [linux/amd64 build-node-django 1/1] RUN mkdir /build/api && cd frontend && npm run bundledjango:
#36 46.35 .js
#36 46.35 Field 'browser' doesn't contain a valid alias configuration
#36 46.35 /build/frontend/common/useThrottle.js doesn't exist
#36 46.35 as directory
#36 46.35 /build/frontend/common/useThrottle doesn't exist
#36 46.35 @ ./web/components/pages/UserPage.tsx 41:48-86
#36 46.35 @ ./web/routes.js 15:39-77
#36 46.35 @ ./web/main.js 11:37-56
#36 46.35
#36 46.35 webpack 5.94.0 compiled with 1 error and 7 warnings in 44940 ms
There is a import useThrottle from 'common/useThrottle'
in TableSearchFilter
that needs to be directly replaced with import useDebounce from 'common/useDebounce'
line 14 const searchItems = useDebounce(
Then we can approve
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes:
This PR addresses issue #5370 where the frontend was making too many aggressive API requests to the identities endpoint when searching. I've implemented the following changes:
-->Increased the throttle delay in useSearchThrottle.ts from 100ms to 500ms
-->Increased the default throttle value in useInfiniteScroll.ts from 100ms to 500ms
-->These changes significantly reduce the request rate from the frontend while maintaining reasonable responsiveness. The throttling mechanism now waits longer between keystrokes before sending requests, preventing unnecessary database load.
#5370