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.
This commit is contained in:
Shantanu Gupta
2025-11-11 01:55:39 +05:30
committed by GitHub
parent 39017f43b8
commit 06b8ea7c36
@@ -87,7 +87,7 @@ export const useLazyFetchAllRecords = <T>({
await sleep(delayMs);
}
const rawResult = await fetchMoreRecordsLazy();
const rawResult = await fetchMoreRecordsLazy(limit);
const fetchMoreResult = rawResult?.data;