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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ali Waseem authored and GitHub committed 2026-06-09 08:25:29 -06:00
1 parent 2c915ca9fb
commit 289accd7d4
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -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
+5 -5
View File
@@ -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)
})