Skip to content

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

fix: warning message on upgrade guards (#36646)

Bobbie Soedirgo226d05fb8341
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
index 8f767224235..6cb810871b5 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
@@ -193,6 +193,7 @@ const InfrastructureInfo = () => {
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
+ {/* TODO(bobbie): once extension_dependent_objects is removed on the backend, remove this block and the ts-ignores below */}
{!data?.eligible && (data?.extension_dependent_objects || []).length > 0 && (
<Alert_Shadcn_
variant="warning"
@@ -222,7 +223,6 @@ const InfrastructureInfo = () => {
? 'These extensions are not supported in newer versions of Supabase Postgres. If you are not using them, it is safe to remove them.'
: 'Check the docs for which ones might need to be removed.'}
</p>
-
<div>
<Button size="tiny" type="default" asChild>
<a
@@ -237,6 +237,93 @@ const InfrastructureInfo = () => {
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
+ {!data?.eligible &&
+ // @ts-ignore
+ (data?.objects_to_be_dropped || []).length > 0 && (
+ <Alert_Shadcn_
+ variant="warning"
+ title="A new version of Postgres is available for your project"
+ >
+ <AlertTitle_Shadcn_>
+ A new version of Postgres is available
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_ className="flex flex-col gap-3">
+ <div>
+ <p className="mb-1">
+ You'll need to remove the following objects before upgrading:
+ </p>
+
+ <ul className="pl-4">
+ {
+ // @ts-ignore
+ (data?.objects_to_be_dropped || []).map((obj: string) => (
+ <li className="list-disc" key={obj}>
+ {obj}
+ </li>
+ ))
+ }
+ </ul>
+ </div>
+ <p>Check the docs for which objects need to be removed.</p>
+ <div>
+ <Button size="tiny" type="default" asChild>
+ <a
+ href="https://supabase.com/docs/guides/platform/upgrading#extensions"
+ target="_blank"
+ rel="noreferrer"
+ >
+ View docs
+ </a>
+ </Button>
+ </div>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
+ {!data?.eligible &&
+ // @ts-ignore
+ (data?.unsupported_extensions || []).length > 0 && (
+ <Alert_Shadcn_
+ variant="warning"
+ title="A new version of Postgres is available for your project"
+ >
+ <AlertTitle_Shadcn_>
+ A new version of Postgres is available
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_ className="flex flex-col gap-3">
+ <div>
+ <p className="mb-1">
+ You'll need to remove the following extensions before upgrading:
+ </p>
+
+ <ul className="pl-4">
+ {
+ // @ts-ignore
+ (data?.unsupported_extensions || []).map((obj: string) => (
+ <li className="list-disc" key={obj}>
+ {obj}
+ </li>
+ ))
+ }
+ </ul>
+ </div>
+ <p>
+ These extensions are not supported in newer versions of Supabase
+ Postgres. If you are not using them, it is safe to remove them.
+ </p>
+ <div>
+ <Button size="tiny" type="default" asChild>
+ <a
+ href="https://supabase.com/docs/guides/platform/upgrading#extensions"
+ target="_blank"
+ rel="noreferrer"
+ >
+ View docs
+ </a>
+ </Button>
+ </div>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
</>
)}
</>
diff --git a/packages/ai-commands/src/docs.ts b/packages/ai-commands/src/docs.ts
index 5152655e018..07111da4cb0 100644
--- a/packages/ai-commands/src/docs.ts
+++ b/packages/ai-commands/src/docs.ts
@@ -63,7 +63,7 @@ export async function clippy(
const [{ embedding }] = embeddingResponse.data
- const { error: matchError, data: pageSections } = await supabaseClient
+ const { error: matchError, data: pageSections } = (await supabaseClient
.rpc('match_page_sections_v2', {
embedding,
match_threshold: 0.78,
@@ -71,7 +71,7 @@ export async function clippy(
})
.neq('rag_ignore', true)
.select('content,page!inner(path),rag_ignore')
- .limit(10) as { error: any; data: PageSection[] | null }
+ .limit(10)) as { error: any; data: PageSection[] | null }
if (matchError || !pageSections) {
throw new ApplicationError('Failed to match page sections', matchError)
@@ -93,10 +93,10 @@ export async function clippy(
}
const pagePath = pageSection.page.path
-
+
// Include source reference with each section
contextText += `[Source ${sourceIndex}: ${pagePath}]\n${content.trim()}\n---\n`
-
+
// Track sources for later reference
if (!sourcesMap.has(pagePath)) {
sourcesMap.set(pagePath, content)
diff --git a/packages/ui-patterns/src/CommandMenu/prepackaged/ai/utils.ts b/packages/ui-patterns/src/CommandMenu/prepackaged/ai/utils.ts
index dc88db896be..96f64044e59 100644
--- a/packages/ui-patterns/src/CommandMenu/prepackaged/ai/utils.ts
+++ b/packages/ui-patterns/src/CommandMenu/prepackaged/ai/utils.ts
@@ -49,7 +49,12 @@ interface FinalizeWithSourcesAction {
index: number
}
-type MessageAction = NewMessageAction | UpdateMessageAction | AppendContentAction | ResetAction | FinalizeWithSourcesAction
+type MessageAction =
+ | NewMessageAction
+ | UpdateMessageAction
+ | AppendContentAction
+ | ResetAction
+ | FinalizeWithSourcesAction
export { MessageRole, MessageStatus }
export type { Message, MessageAction, SourceLink }