Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Set stale time for users infinite query on auth/users to infinite (#33308)

Joshen Lima7f872dd4ec5
diff --git a/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx b/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx
index f53f8d675b7..0c1699cfa10 100644
--- a/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx
+++ b/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx
@@ -7,22 +7,19 @@ import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useTableEditorQuery } from 'data/table-editor/table-editor-query'
import { isTableLike } from 'data/table-editor/table-editor-types'
import { useTablesQuery } from 'data/tables/tables-query'
-import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
import { Popover_Shadcn_, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_ } from 'ui'
import type { SupaRow } from '../../types'
import { NullValue } from '../common/NullValue'
import { ReferenceRecordPeek } from './ReferenceRecordPeek'
interface Props extends PropsWithChildren<RenderCellProps<SupaRow, unknown>> {
- projectRef?: string
tableId?: string
}
export const ForeignKeyFormatter = (props: Props) => {
const { project } = useProjectContext()
- const { selectedSchema } = useQuerySchemaState()
- const { projectRef, tableId, row, column } = props
+ const { tableId, row, column } = props
const id = tableId ? Number(tableId) : undefined
const { data } = useTableEditorQuery({
diff --git a/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx b/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx
index 91d1c3fda33..f8dfb7a3afd 100644
--- a/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx
+++ b/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx
@@ -124,6 +124,9 @@ export const UsersV2 = () => {
},
{
keepPreviousData: Boolean(filterKeywords),
+ // [Joshen] This is to prevent the dashboard from invalidating when refocusing as it may create
+ // a barrage of requests to invalidate each page esp when the project has many many users.
+ staleTime: Infinity,
}
)