From 289accd7d4969ee60dbe9e08215100a0f59d34a7 Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Tue, 9 Jun 2026 08:25:29 -0600 Subject: [PATCH] chore: Update time from 10 to 20 minutes for pause projects fallback (#46479) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Minor update for long running state thresholds when updating project sizes ## Summary by CodeRabbit * **Chores** * Increased the minimum threshold for recognizing long-running operations from 10 to 20 minutes, reducing premature fallback behavior and improving stability for longer tasks. * **Tests** * Updated test suite to validate the new 20-minute threshold across default, missing, small, and larger restore scenarios. --- apps/studio/lib/project-transition-state.ts | 2 +- apps/studio/lib/restore-estimate.test.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/studio/lib/project-transition-state.ts b/apps/studio/lib/project-transition-state.ts index 871533bc81d..ae46dec73ca 100644 --- a/apps/studio/lib/project-transition-state.ts +++ b/apps/studio/lib/project-transition-state.ts @@ -1,6 +1,6 @@ import { safeLocalStorage } from 'common' -export const FALLBACK_LONG_RUNNING_STATE_THRESHOLD_MINUTES = 10 +export const FALLBACK_LONG_RUNNING_STATE_THRESHOLD_MINUTES = 20 // Persist long enough for same-browser reloads, but not so long that a later transition reuses stale state. export const MAX_PERSISTED_TRANSITION_AGE_HOURS = 24 diff --git a/apps/studio/lib/restore-estimate.test.ts b/apps/studio/lib/restore-estimate.test.ts index 3ad94014e70..1f1d5bdf532 100644 --- a/apps/studio/lib/restore-estimate.test.ts +++ b/apps/studio/lib/restore-estimate.test.ts @@ -11,14 +11,14 @@ describe('restore-estimate', () => { expect(estimateRestoreTimeFromSizeGb(21_000)).toBeCloseTo(723, 0) }) - it('uses a 10 minute floor when size is missing or small', () => { - expect(getRestoreLongRunningThresholdMinutes()).toBe(10) - expect(getRestoreLongRunningThresholdMinutes(null)).toBe(10) - expect(getRestoreLongRunningThresholdMinutes(100)).toBe(10) + it('uses a 20 minute floor when size is missing or small', () => { + expect(getRestoreLongRunningThresholdMinutes()).toBe(20) + expect(getRestoreLongRunningThresholdMinutes(null)).toBe(20) + expect(getRestoreLongRunningThresholdMinutes(100)).toBe(20) }) it('scales the long-running threshold for larger restores', () => { - expect(getRestoreLongRunningThresholdMinutes(200)).toBe(15) + expect(getRestoreLongRunningThresholdMinutes(200)).toBe(20) expect(getRestoreLongRunningThresholdMinutes(500)).toBe(31) expect(getRestoreLongRunningThresholdMinutes(1_000)).toBe(56) })