fix:Improve filter synchronization and data fetching in SearchControls#398
Merged
fix:Improve filter synchronization and data fetching in SearchControls#398
Conversation
…Controls and useFetchData
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…
This pull request focuses on improving the stability and reliability of the data fetching and polling logic in the frontend, especially within the
useFetchDatahook. It introduces robust handling of component mount state, avoids redundant requests, and improves synchronization between internal state and parent components. Additionally, it updates the Vite config to adjust proxy paths for backend services.Improvements to data fetching and polling (
useFetchData):isMountedRefandisPollingRefto safely manage polling and data updates, preventing state updates on unmounted components and ensuring polling state is always accurate. [1] [2] [3] [4] [5] [6]searchParamsdirectly to storing it in a ref (searchParamsRef), ensuring the latest parameters are always used in async callbacks and avoiding stale closures. [1] [2] [3]useEffect, reducing unnecessary data fetches and preventing race conditions.useMemo) and improved comments for clarity.Synchronization improvements in search controls:
useEffect, reducing the risk of update cycles. [1] [2]Development environment configuration:
frontend/vite.config.tsto adjust the proxy paths for Python and Java backend services, reflecting changes in service architecture.