From 06b8ea7c364e4db282a463a6ab4be2ceac79bbc5 Mon Sep 17 00:00:00 2001 From: Shantanu Gupta <118614615+shantanugupta2004@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:55:39 +0530 Subject: [PATCH] FIX: export view not exporting all records (#15509) Fixes #15508 Addresses the issue where the "Export View" functionality was not exporting all records from a view. Users reported that only a subset of records were exported, even when the view contained more. This led to incomplete data exports. The core of the problem was found within the `useLazyFetchAllRecords` hook. The `fetchMoreRecordsLazy` function, which is responsible for fetching subsequent pages of data during the export process, was inadvertently using a default page limit (`DEFAULT_SEARCH_REQUEST_LIMIT` of 60 records) instead of the intended `pageSize` (200 records). This discrepancy caused the export process to prematurely stop fetching records. The PR modifies `packages/twenty-front/src/modules/object-record/hooks/useLazyFetchAllRecords.ts` to explicitly pass the `limit` parameter (which correctly reflects the `pageSize`) to the `fetchMoreRecordsLazy` function. This ensures that all subsequent data fetches during an export operation adhere to the configured page size, allowing for the complete retrieval of all records. --- .../src/modules/object-record/hooks/useLazyFetchAllRecords.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/hooks/useLazyFetchAllRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/useLazyFetchAllRecords.ts index 9dee8e1bd7..01d84c47ff 100644 --- a/packages/twenty-front/src/modules/object-record/hooks/useLazyFetchAllRecords.ts +++ b/packages/twenty-front/src/modules/object-record/hooks/useLazyFetchAllRecords.ts @@ -87,7 +87,7 @@ export const useLazyFetchAllRecords = ({ await sleep(delayMs); } - const rawResult = await fetchMoreRecordsLazy(); + const rawResult = await fetchMoreRecordsLazy(limit); const fetchMoreResult = rawResult?.data;