QueryClientProvider refactor

Created by: jpggvilaca

📝 Description

Why did this come up? I wanted to decouple notifications from a few places, which let me to update the mutation cache, which led to tests failing, which led to realising we were using different clients, which might be dangerous since then we'll be testing something different from what our main app uses. And here we are. QueryClient now triggers notifications instead of each hook doing it. Which means the tests need the correct query client to test the existence of those notifications.

Note: I will wait for the release to merge this.

  • RequiredProvidersRender will now use the actual query client we use for the geti app
  • Extract query client creation to its own function
  • Add mutationCache to our query client to inherit the same behavior we already have with queryCache (to trigger a notification onError)

For the next PRs:

  • Leverage the query and mutation cache and get rid of all addNotification (non-custom ones) from all consumers.

Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • Tested manually
  • 🤖 Run automated end-to-end tests

Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or my feature works

Merge request reports

Loading