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 @@ -689,10 +689,19 @@ export async function executeSync(
689689 contentHash : fullDoc . contentHash ?? op . extDoc . contentHash ,
690690 metadata : { ...op . extDoc . metadata , ...fullDoc . metadata } ,
691691 } )
692+ } else if ( op . type === 'update' ) {
693+ // Already-indexed file is kept as last-known-good (not downgraded), so it
694+ // counts as unchanged rather than slipping past every result counter.
695+ result . docsUnchanged ++
692696 }
693697 return null
694698 }
695- if ( ! fullDoc ?. content . trim ( ) ) return null
699+ if ( ! fullDoc ?. content . trim ( ) ) {
700+ // An empty re-fetch leaves an already-indexed update as last-known-good; count
701+ // it as unchanged so the totals still reconcile with documents seen.
702+ if ( op . type === 'update' ) result . docsUnchanged ++
703+ return null
704+ }
696705 const hydratedHash = fullDoc . contentHash ?? op . extDoc . contentHash
697706 if (
698707 op . type === 'update' &&
You can’t perform that action at this time.
0 commit comments