File tree Expand file tree Collapse file tree
apps/sim/lib/knowledge/connectors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -415,6 +415,21 @@ export async function executeSync(
415415 hasMore = page . hasMore
416416 }
417417
418+ if ( hasMore ) {
419+ /**
420+ * Pagination stopped before the source was exhausted — either the
421+ * MAX_PAGES guard tripped or the connector reported hasMore without a
422+ * cursor. The listing is incomplete, so flag it to suppress deletion
423+ * reconciliation; otherwise documents beyond the truncation point would
424+ * be removed even though they still exist in the source.
425+ */
426+ syncContext . listingCapped = true
427+ logger . warn ( 'Pagination ended before source exhaustion; skipping deletion reconciliation' , {
428+ connectorId,
429+ docsSoFar : externalDocs . length ,
430+ } )
431+ }
432+
418433 logger . info ( `Fetched ${ externalDocs . length } documents from ${ connectorConfig . name } ` , {
419434 connectorId,
420435 } )
You can’t perform that action at this time.
0 commit comments