Replace the alerts worker with React Query while maintaining the existing functionality without modifying the store and other components. This refactor is a preparatory step for a future rearchitecture and will enable fetching with filters in a subsequent phase.
Steps
Remove Alerts Worker
Remove the current implementation of the alerts worker used for fetching data.
Introduce React Query
Use React Query to fetch alerts data.
Ensure the fetching logic retains the same interval as the alerts worker.
Migrate Alert Worker Logic to React Query
Transfer the logic from the worker function into the React Query fetching promise.
Ensure the fetched data structure matches the existing structure used in the application.
Save Fetching Results
Save the results fetched by React Query into the Zustand store.
Maintain compatibility with the existing store structure and ensure no changes are required in other components.
Acceptance Criteria
The alerts worker is fully removed.
React Query is successfully integrated for fetching alerts data.
The fetching interval remains consistent with the worker's behavior.
The results fetched by React Query match the existing data structure and are stored in the Zustand store.
All existing components relying on the Zustand store remain functional without modification.
Related to
621
Notes
This refactor does not introduce new functionality, such as filtering, but sets the groundwork for such changes in a subsequent iteration.
Description
Replace the alerts worker with React Query while maintaining the existing functionality without modifying the store and other components. This refactor is a preparatory step for a future rearchitecture and will enable fetching with filters in a subsequent phase.
Steps
Remove Alerts Worker
Introduce React Query
Migrate Alert Worker Logic to React Query
Save Fetching Results
Acceptance Criteria
Related to
621
Notes