refactor(api): Migrate hooks to React Query and centralize query logic - #7206
Open
balazs-szucs wants to merge 18 commits into
Open
refactor(api): Migrate hooks to React Query and centralize query logic#7206balazs-szucs wants to merge 18 commits into
balazs-szucs wants to merge 18 commits into
Conversation
balazs-szucs
requested review from
ConnorYoh,
EthanHealy01,
Frooodle and
jbrunton96
as code owners
July 30, 2026 18:52
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors frontend configuration/availability hooks to use TanStack React Query, centralizing fetch logic and query keys so config and feature-availability data is cached, deduped, and easier to invalidate consistently across the app.
Changes:
- Migrated
AppConfigProvider, endpoint availability, and group-enabled checks touseQuerywith shared query keys and endpoint fetch helpers. - Added an editor-scoped
QueryClientProviderand a sharedQueryClientfactory with default query behavior. - Updated/added test wrappers to provide
QueryClientProviderfor hooks that now depend on React Query context.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/editor/src/desktop/hooks/useSaasAppConfig.ts | Moves SaaS app-config reads to React Query with invalidation on connection-mode changes. |
| frontend/editor/src/desktop/hooks/useGroupEnabled.ts | Uses React Query for group-enabled checks while preserving offline short-circuit behavior. |
| frontend/editor/src/core/queryClient.ts | Adds a shared QueryClient factory for editor defaults. |
| frontend/editor/src/core/queries/keys.ts | Centralizes editor React Query keys. |
| frontend/editor/src/core/queries/endpoints.ts | Centralizes endpoint/group-enabled fetch functions and endpoint availability normalization. |
| frontend/editor/src/core/hooks/usePosthogTracking.test.tsx | Updates tests to wrap hooks in QueryClientProvider. |
| frontend/editor/src/core/hooks/useGroupEnabled.ts | Migrates OSS group-enabled hook to React Query. |
| frontend/editor/src/core/hooks/useEndpointConfig.ts | Migrates endpoint availability hooks to React Query with a shared invalidation helper. |
| frontend/editor/src/core/contexts/AppConfigContext.tsx | Refactors AppConfigProvider to use React Query (retry, auth-page gating, invalidation). |
| frontend/editor/src/core/contexts/AppConfigContext.test.tsx | Updates AppConfigContext tests to include QueryClientProvider. |
| frontend/editor/src/core/components/AppProviders.tsx | Wraps the provider tree with QueryClientProvider and instantiates a stable client via useState. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ider null safety and type consistency
…in and MFA over analytics consent
…test-results tracking
Collaborator
Author
|
/deploypr |
# Conflicts: # frontend/editor/src/core/components/AppProviders.tsx # frontend/editor/src/core/hooks/useGroupEnabled.ts # frontend/editor/src/desktop/hooks/useGroupEnabled.ts
# Conflicts: # frontend/editor/src/core/contexts/AppConfigContext.test.tsx # frontend/editor/src/core/contexts/AppConfigContext.tsx # frontend/editor/src/core/hooks/usePosthogTracking.test.tsx
# Conflicts: # frontend/editor/src/core/hooks/useEndpointConfig.ts
Member
|
A lot of this tanstack got done by @ConnorYoh how much of this PR should remain? |
balazs-szucs
temporarily deployed
to
ci-signing
August 29, 2026 22:47 — with
GitHub Actions
Inactive
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.
Description of Changes
Migrates misc to Tanstack. Main aim: better perf. Some centralization also.
Changes:
AppConfigProviderto use React Query (useQuery) for fetching and caching app configuration, replacing custom state and retry logic with query-based management. This improves error handling, retry behavior, and integration with other data-fetching logic.AppProviderstree with aQueryClientProviderand initialized the query client usinguseState, ensuring all child components have access to React Query context.AppProviderssignature and structure to support the new provider hierarchy.Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass