File tree Expand file tree Collapse file tree 5 files changed +8
-1
lines changed
Expand file tree Collapse file tree 5 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,7 @@ async function listDocumentsV2(
456456 const totalFetched = ( ( syncContext ?. totalDocsFetched as number ) ?? 0 ) + documents . length
457457 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
458458 const hitLimit = maxPages > 0 && totalFetched >= maxPages
459+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
459460
460461 return {
461462 documents,
@@ -621,6 +622,7 @@ async function listDocumentsViaCql(
621622 const totalFetched = ( ( syncContext ?. totalDocsFetched as number ) ?? 0 ) + documents . length
622623 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
623624 const hitLimit = maxPages > 0 && totalFetched >= maxPages
625+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
624626
625627 const totalSize = ( data . totalSize as number ) ?? 0
626628 const nextStart = start + results . length
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ export const dropboxConnector: ConnectorConfig = {
206206 const totalFetched = previouslyFetched + documents . length
207207 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
208208 const hitLimit = maxFiles > 0 && totalFetched >= maxFiles
209+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
209210
210211 return {
211212 documents,
Original file line number Diff line number Diff line change @@ -454,6 +454,7 @@ async function listFromWorkspace(
454454 const totalFetched = ( ( syncContext ?. totalDocsFetched as number ) ?? 0 ) + documents . length
455455 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
456456 const hitLimit = maxPages > 0 && totalFetched >= maxPages
457+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
457458
458459 const nextCursor = hitLimit ? undefined : ( ( data . next_cursor as string ) ?? undefined )
459460
@@ -509,6 +510,7 @@ async function listFromDatabase(
509510 const totalFetched = ( ( syncContext ?. totalDocsFetched as number ) ?? 0 ) + documents . length
510511 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
511512 const hitLimit = maxPages > 0 && totalFetched >= maxPages
513+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
512514
513515 const nextCursor = hitLimit ? undefined : ( ( data . next_cursor as string ) ?? undefined )
514516
@@ -604,6 +606,7 @@ async function listFromParentPage(
604606 const totalFetched = ( ( syncContext ?. totalDocsFetched as number ) ?? 0 ) + documents . length
605607 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
606608 const hitLimit = maxPages > 0 && totalFetched >= maxPages
609+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
607610
608611 const nextCursor = hitLimit ? undefined : ( ( data . next_cursor as string ) ?? undefined )
609612
Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ export const onedriveConnector: ConnectorConfig = {
239239 const totalFetched = previouslyFetched + documents . length
240240 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
241241 const hitLimit = maxFiles > 0 && totalFetched >= maxFiles
242+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
242243
243244 const nextLink = data [ '@odata.nextLink' ]
244245
Original file line number Diff line number Diff line change @@ -393,8 +393,8 @@ export const sharepointConnector: ConnectorConfig = {
393393
394394 if ( syncContext ) syncContext . totalDocsFetched = totalFetched
395395 const hitLimit = maxFiles > 0 && totalFetched >= maxFiles
396+ if ( hitLimit && syncContext ) syncContext . listingCapped = true
396397
397- // Determine next cursor
398398 if ( hitLimit ) {
399399 return { documents, hasMore : false }
400400 }
You can’t perform that action at this time.
0 commit comments