diff --git a/core/core.ts b/core/core.ts index a5514490a..63c03a730 100644 --- a/core/core.ts +++ b/core/core.ts @@ -727,7 +727,7 @@ export class Core { } private indexingCancellationController: AbortController | undefined; - private async sendIndexingTelemetry(update: IndexingProgressUpdate) { + private async sendIndexingErrorTelemetry(update: IndexingProgressUpdate) { console.debug( "Indexing failed with error: ", update.desc, @@ -763,11 +763,12 @@ export class Core { this.indexingState = updateToSend; if (update.status === "failed") { - void this.sendIndexingTelemetry(update); + void this.sendIndexingErrorTelemetry(update); } } this.messenger.send("refreshSubmenuItems", undefined); + this.indexingCancellationController = undefined; } private async refreshCodebaseIndexFiles(files: string[]) { @@ -784,7 +785,6 @@ export class Core { this.indexingCancellationController = new AbortController(); for await (const update of (await this.codebaseIndexerPromise).refreshFiles( files, - this.indexingCancellationController.signal, )) { let updateToSend = { ...update }; if (update.status === "failed") { @@ -797,7 +797,7 @@ export class Core { this.indexingState = updateToSend; if (update.status === "failed") { - void this.sendIndexingTelemetry(update); + void this.sendIndexingErrorTelemetry(update); } } diff --git a/core/indexing/CodebaseIndexer.ts b/core/indexing/CodebaseIndexer.ts index 175e1a062..5c70f8bad 100644 --- a/core/indexing/CodebaseIndexer.ts +++ b/core/indexing/CodebaseIndexer.ts @@ -147,7 +147,6 @@ export class CodebaseIndexer { async *refreshFiles( files: string[], - abortSignal: AbortSignal, ): AsyncGenerator { let progress = 0; if (files.length === 0) { @@ -173,14 +172,6 @@ export class CodebaseIndexer { if (this.pauseToken.paused) { yield* this.yieldUpdateAndPause(); } - if (abortSignal.aborted) { - yield { - progress: 1, - desc: "Indexing cancelled", - status: "disabled", - }; - return; - } } yield {