- {retryPolicy === 'no_retry' ? (
-
-
- This error requires manual intervention from our{' '}
-
- support
-
- . Alternatively, you may also recreate the pipeline. Use the table actions menu on the
- right to view the full error details.
-
-
- ) : retryPolicy === 'manual_retry' ? (
-
-
-
-
-
-
Action required to continue replication
-
- {state.solution}
- {state.solution && !/[.!?]$/.test(state.solution.trim()) && '.'}
-
-
- Restart table replication from the table actions menu on the right. The pipeline
- will restart automatically.
-
-
-
-
-
- ) : retryPolicy === 'timed_retry' ? (
-
-
- Replication will retry automatically. The pipeline will restart to apply the retry.
-
-
-
- ) : null}
-
- )
}
diff --git a/apps/studio/components/interfaces/Database/Replication/RetryCountdown.tsx b/apps/studio/components/interfaces/Database/Replication/RetryCountdown.tsx
index 6b5b1edf650..a4e23a28f58 100644
--- a/apps/studio/components/interfaces/Database/Replication/RetryCountdown.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/RetryCountdown.tsx
@@ -1,107 +1,35 @@
-import { useCallback, useEffect, useMemo, useState } from 'react'
+import dayjs from 'dayjs'
+import { useEffect, useState } from 'react'
interface RetryCountdownProps {
- nextRetryTime: string // RFC3339 formatted date
+ /** RFC 3339 timestamp of the next automatic retry */
+ nextRetryTime: string
}
-interface TimeRemaining {
- days: number
- hours: number
- minutes: number
- seconds: number
- isExpired: boolean
- isInvalid: boolean
+const formatRemaining = (milliseconds: number) => {
+ const duration = dayjs.duration(milliseconds)
+ if (duration.asHours() >= 1) return `${Math.floor(duration.asHours())}h ${duration.minutes()}m`
+ if (duration.asMinutes() >= 1) return `${duration.minutes()}m ${duration.seconds()}s`
+ return `${duration.seconds()}s`
}
export const RetryCountdown = ({ nextRetryTime }: RetryCountdownProps) => {
- const [timeRemaining, setTimeRemaining] = useState