Files
supabase/apps/studio/data/replication/invalidate-pipeline-queries.ts
K-Dog (Kevin) 27c4433a3e feat: revised project add-ons page (#54186)
The current add-ons page only lists a subset of available add-ons, which
often causes confusion with things like Advanced MFA Auth (customers
cant find where to configure it).

The revised add-on page covers all potentially configured project
add-ons including replicas and advanced disk. This should help the
customer locate configured add-ons and at the same time discover
potentially interesting add-ons. This can be enhanced further in the
future with "smart" suggestions based on usage.
2026-11-30 21:54:44 +08:00

24 lines
915 B
TypeScript

import type { QueryClient, QueryKey } from '@tanstack/react-query'
import { subscriptionKeys } from '../subscriptions/keys'
import { replicationKeys } from './keys'
const isPollingQuery = ({ queryKey }: { queryKey: QueryKey }) =>
queryKey.at(-1) === 'status' || queryKey.at(-1) === 'replication-status'
export const invalidateReplicationPipelineQueries = (
queryClient: QueryClient,
projectRef: string | undefined
) => {
const queryKey = replicationKeys.pipelines(projectRef)
return Promise.all([
queryClient.invalidateQueries({ queryKey, predicate: (query) => !isPollingQuery(query) }),
// Polls will refresh again after the current read; metadata needs a post-mutation read now.
queryClient.invalidateQueries(
{ queryKey, predicate: isPollingQuery },
{ cancelRefetch: false }
),
queryClient.invalidateQueries({ queryKey: subscriptionKeys.addons(projectRef) }),
])
}