Skip to content

Commit 688834f

Browse files
authored
fix: Fix infinite loading in the Cron jobs table (supabase#45421)
This PR fixes an issue where the infinite list doesn't work for cron jobs. If the initial data (20 cronjobs) renders and you have a tall monitor to fit the entire table, the `react-data-grid` can't `onScroll` event which fetches the next page. To test: 1. Add 40-50 cron jobs by running `SELECT cron.schedule('test 30', '0 2 * * 1', 'select 1');` repeatedly. 2. Open the /project/_/integrations/cron/jobs 3. See if you can scroll and trigger the second page. Fixes https://linear.app/supabase/issue/FE-3117/cron-job-is-not-scrollable
1 parent e311b70 commit 688834f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/studio/data/database-cron-jobs/database-cron-jobs-infinite-query.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { databaseCronJobsKeys } from './keys'
55
import { COST_THRESHOLD_ERROR, executeSql } from '@/data/sql/execute-sql-query'
66
import type { ResponseError, UseCustomInfiniteQueryOptions } from '@/types'
77

8-
export const CRON_JOBS_PAGE_LIMIT = 20
8+
// The value is intentionally high because the data grid needs to overflow so that `onScroll` event work and trigger
9+
// the infinite loading. If the value is too low, there won't be enough items to overflow and trigger the event.
10+
export const CRON_JOBS_PAGE_LIMIT = 40
911

1012
export type DatabaseCronJobRunsVariables = {
1113
projectRef?: string

0 commit comments

Comments
 (0)