Skip to content
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

[TASK] (supernova): Remove Alerts Worker and Introduce React Query #628

Closed
Tracked by #621
ArtieReus opened this issue Nov 20, 2024 · 1 comment · Fixed by #658
Closed
Tracked by #621

[TASK] (supernova): Remove Alerts Worker and Introduce React Query #628

ArtieReus opened this issue Nov 20, 2024 · 1 comment · Fixed by #658
Assignees
Labels
refactor supernova All tasks related to supernova

Comments

@ArtieReus
Copy link
Collaborator

ArtieReus commented Nov 20, 2024

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

  1. Remove Alerts Worker

    • Remove the current implementation of the alerts worker used for fetching data.
  2. Introduce React Query

    • Use React Query to fetch alerts data.
    • Ensure the fetching logic retains the same interval as the alerts worker.
  3. 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.
  4. 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

Notes

  • This refactor does not introduce new functionality, such as filtering, but sets the groundwork for such changes in a subsequent iteration.
@ArtieReus ArtieReus changed the title Remove Alerts Worker and Introduce React Query [TASK] (supernova): Remove Alerts Worker and Introduce React Query Nov 20, 2024
@ArtieReus ArtieReus added supernova All tasks related to supernova refactor labels Nov 20, 2024
@TilmanHaupt
Copy link
Contributor

I also will do the same for the silences worker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor supernova All tasks related to supernova
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants