From 660bda004bd167b8f71464125b03f359ed91128f Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:58:47 +0530 Subject: [PATCH] check equality for artifact id --- core/indexing/CodebaseIndexer.test.ts | 7 ++++--- core/indexing/CodebaseIndexer.ts | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/indexing/CodebaseIndexer.test.ts b/core/indexing/CodebaseIndexer.test.ts index 783202add..a49cca85d 100644 --- a/core/indexing/CodebaseIndexer.test.ts +++ b/core/indexing/CodebaseIndexer.test.ts @@ -21,6 +21,7 @@ import CodebaseContextProvider from "../context/providers/CodebaseContextProvide import { ContinueConfig } from "../index.js"; import { localPathToUri } from "../util/pathToUri.js"; import { CodebaseIndexer } from "./CodebaseIndexer.js"; +import { FullTextSearchCodebaseIndex } from "./FullTextSearchCodebaseIndex.js"; import { getComputeDeleteAddRemove } from "./refreshIndex.js"; import { TestCodebaseIndex } from "./TestCodebaseIndex.js"; import { CodebaseIndex } from "./types.js"; @@ -827,7 +828,7 @@ describe("CodebaseIndexer", () => { test("should return true when indexes to build differ from built indexes", async () => { const mockIndex1 = new TestCodebaseIndex(); - const mockIndex2 = new TestCodebaseIndex(); + const mockIndex2 = new FullTextSearchCodebaseIndex(); mockGetIndexesToBuild.mockResolvedValue([mockIndex1]); (testIndexer as any).builtIndexes = [mockIndex2]; @@ -837,7 +838,7 @@ describe("CodebaseIndexer", () => { test("should return true when there are more indexes to build than built indexes", async () => { const mockIndex1 = new TestCodebaseIndex(); - const mockIndex2 = new TestCodebaseIndex(); + const mockIndex2 = new FullTextSearchCodebaseIndex(); mockGetIndexesToBuild.mockResolvedValue([mockIndex1, mockIndex2]); (testIndexer as any).builtIndexes = [mockIndex1]; @@ -847,7 +848,7 @@ describe("CodebaseIndexer", () => { test("should return false when there are fewer indexes to build than built indexes", async () => { const mockIndex1 = new TestCodebaseIndex(); - const mockIndex2 = new TestCodebaseIndex(); + const mockIndex2 = new FullTextSearchCodebaseIndex(); mockGetIndexesToBuild.mockResolvedValue([mockIndex1]); (testIndexer as any).builtIndexes = [mockIndex1, mockIndex2]; diff --git a/core/indexing/CodebaseIndexer.ts b/core/indexing/CodebaseIndexer.ts index 072755b61..266c7ddcc 100644 --- a/core/indexing/CodebaseIndexer.ts +++ b/core/indexing/CodebaseIndexer.ts @@ -727,7 +727,9 @@ export class CodebaseIndexer { public async wasIndexesChanged() { const indexes = await this.getIndexesToBuild(); return !indexes.every((index) => - this.builtIndexes.some((builtIndex) => builtIndex === index), + this.builtIndexes.some( + (builtIndex) => builtIndex.artifactId === index.artifactId, + ), ); }