Skip to content

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

Update service status checks text note when some services are unhealthy (#40767)

Joshen Limff38efd38f51
diff --git a/apps/studio/components/interfaces/Home/ServiceStatus.tsx b/apps/studio/components/interfaces/Home/ServiceStatus.tsx
index 95226b175ed..f977e8517e7 100644
--- a/apps/studio/components/interfaces/Home/ServiceStatus.tsx
+++ b/apps/studio/components/interfaces/Home/ServiceStatus.tsx
@@ -3,8 +3,8 @@ import { AlertTriangle, CheckCircle2, ChevronRight, Loader2 } from 'lucide-react
import Link from 'next/link'
import { useEffect, useState } from 'react'
-import { PopoverSeparator } from '@ui/components/shadcn/ui/popover'
import { useParams } from 'common'
+import { InlineLink } from 'components/ui/InlineLink'
import { useBranchesQuery } from 'data/branches/branches-query'
import { useEdgeFunctionServiceStatusQuery } from 'data/service-status/edge-functions-status-query'
import {
@@ -335,16 +335,27 @@ export const ServiceStatus = () => {
</div>
</Link>
))}
- {allServicesOperational ? null : (
- <>
- <PopoverSeparator />
- <div className="flex gap-2 text-xs text-foreground-light px-3 py-2">
- <div className="mt-0.5">
- <InfoIcon />
- </div>
- Recently restored projects can take up to 5 minutes to become fully operational.
+ {!allServicesOperational && (
+ <div className="flex gap-2 text-xs text-foreground-light px-3 py-2">
+ <div className="mt-0.5">
+ <InfoIcon />
+ </div>
+ <div className="flex flex-col gap-y-1">
+ <p>
+ {isProjectNew ? 'New' : 'Recently restored'} projects can take up to{' '}
+ {SERVICE_STATUS_THRESHOLD} minutes to become fully operational.
+ </p>
+ <p>
+ If services stay unhealthy, refer to our{' '}
+ <InlineLink
+ href={`${DOCS_URL}/guides/troubleshooting/project-status-reports-unhealthy-services`}
+ >
+ docs
+ </InlineLink>{' '}
+ for more information.
+ </p>
</div>
- </>
+ </div>
)}
</PopoverContent_Shadcn_>
</Popover_Shadcn_>
diff --git a/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx b/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
index 62278cfabeb..98b4ba12838 100644
--- a/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
+++ b/apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
@@ -1,8 +1,9 @@
+import dayjs from 'dayjs'
import { AlertTriangle, CheckCircle2, ChevronRight, Loader2 } from 'lucide-react'
import Link from 'next/link'
-import { PopoverSeparator } from '@ui/components/shadcn/ui/popover'
import { useParams } from 'common'
+import { InlineLink } from 'components/ui/InlineLink'
import { SingleStat } from 'components/ui/SingleStat'
import { useBranchesQuery } from 'data/branches/branches-query'
import { useEdgeFunctionServiceStatusQuery } from 'data/service-status/edge-functions-status-query'
@@ -15,6 +16,8 @@ import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { DOCS_URL } from 'lib/constants'
import { InfoIcon, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, cn } from 'ui'
+const SERVICE_STATUS_THRESHOLD = 5 // minutes
+
/**
* [Joshen] JFYI before we go live with this, we need to revisit the migrations section
* as I don't think it should live in the ServiceStatus component since its not indicative
@@ -248,6 +251,7 @@ export const ServiceStatus = () => {
// Check if project or branch is in a startup state
const isProjectNew =
+ dayjs.utc().diff(dayjs.utc(project?.inserted_at), 'minute') < SERVICE_STATUS_THRESHOLD ||
project?.status === 'COMING_UP' ||
(isBranch &&
(currentBranch?.status === 'CREATING_PROJECT' ||
@@ -301,7 +305,7 @@ export const ServiceStatus = () => {
value={<span>{overallStatusLabel}</span>}
/>
</PopoverTrigger_Shadcn_>
- <PopoverContent_Shadcn_ portal className="p-0 w-56" side="bottom" align="start">
+ <PopoverContent_Shadcn_ portal className="p-0 w-60" side="bottom" align="start">
{services.map((service) => (
<Link
href={`/project/${ref}${service.logsUrl}`}
@@ -333,16 +337,27 @@ export const ServiceStatus = () => {
</div>
</Link>
))}
- {allServicesOperational ? null : (
- <>
- <PopoverSeparator />
- <div className="flex gap-2 text-xs text-foreground-light px-3 py-2">
- <div className="mt-0.5">
- <InfoIcon />
- </div>
- Recently restored projects can take up to 5 minutes to become fully operational.
+ {!allServicesOperational && (
+ <div className="flex gap-2 text-xs text-foreground-light px-3 py-2">
+ <div className="mt-0.5">
+ <InfoIcon />
+ </div>
+ <div className="flex flex-col gap-y-1">
+ <p>
+ {isProjectNew ? 'New' : 'Recently restored'} projects can take up to{' '}
+ {SERVICE_STATUS_THRESHOLD} minutes to become fully operational.
+ </p>
+ <p>
+ If services stay unhealthy, refer to our{' '}
+ <InlineLink
+ href={`${DOCS_URL}/guides/troubleshooting/project-status-reports-unhealthy-services`}
+ >
+ docs
+ </InlineLink>{' '}
+ for more information.
+ </p>
</div>
- </>
+ </div>
)}
</PopoverContent_Shadcn_>
</Popover_Shadcn_>