# Fix pagination in SyncManager

SyncManager currently calls the adapter once and stores that page — so any provider
returning a cursor silently loses everything after the first page. Salesforce caps at
2,000 records per query, Rentec pages by offset, GA4 by token: all of them need this.

Find the single fetch inside SyncManager::sync() (the call to syncHistoricalData /
syncIncrementalData) and wrap it in a cursor loop:

    $cursor = null;
    $pages = 0;
    $allRecords = [];

    do {
        $ctx = new SyncContext(
            account: $account,
            credential: $credential,
            resource: $resource,
            cursor: $cursor,
            windowStart: $windowStart,
        );

        $result = $type === 'full'
            ? $adapter->syncHistoricalData($ctx)
            : $adapter->syncIncrementalData($ctx);

        foreach ($result->records as $record) {
            $allRecords[] = $record;
        }

        $cursor = $result->nextCursor;
        $pages++;
    } while ($cursor !== null && $pages < 200);   // hard stop guards a runaway loop

then persist $allRecords exactly as the single-page version did.

200 pages × 2,000 = 400k records, far more headroom than any of these providers need,
while still refusing to spin forever on a misbehaving cursor.
