Skip to content

fix:Improve filter synchronization and data fetching in SearchControls#398

Merged
Dallas98 merged 1 commit intomainfrom
feat/frontend_bug
Mar 2, 2026
Merged

fix:Improve filter synchronization and data fetching in SearchControls#398
Dallas98 merged 1 commit intomainfrom
feat/frontend_bug

Conversation

@Dallas98
Copy link
Collaborator

@Dallas98 Dallas98 commented Mar 2, 2026


This pull request focuses on improving the stability and reliability of the data fetching and polling logic in the frontend, especially within the useFetchData hook. 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):

  • Added isMountedRef and isPollingRef to 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]
  • Switched from using searchParams directly to storing it in a ref (searchParamsRef), ensuring the latest parameters are always used in async callbacks and avoiding stale closures. [1] [2] [3]
  • Replaced the previous debounced effect for search parameter changes with a deep comparison approach using a serialized string and useEffect, reducing unnecessary data fetches and preventing race conditions.
  • Ensured proper cleanup on component unmount: stops polling, hides loading indicators, and prevents further state updates.
  • Minor: Added missing imports (useMemo) and improved comments for clarity.

Synchronization improvements in search controls:

  • In non-controlled mode, immediately notifies the parent component of filter changes instead of relying on useEffect, reducing the risk of update cycles. [1] [2]

Development environment configuration:

  • Updated frontend/vite.config.ts to adjust the proxy paths for Python and Java backend services, reflecting changes in service architecture.

@Dallas98 Dallas98 merged commit a73868e into main Mar 2, 2026
6 checks passed
@Dallas98 Dallas98 deleted the feat/frontend_bug branch March 3, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant