when there are fewer indexes return true

This commit is contained in:
uinstinct 2025-09-04 20:35:22 +05:30
parent 7773a65be3
commit d7066bed4b
2 changed files with 4 additions and 1 deletions

View file

@ -819,7 +819,7 @@ describe("CodebaseIndexer", () => {
(testIndexer as any).builtIndexes = [mockIndex1, mockIndex2];
const result = await testIndexer.wasIndexesChanged();
expect(result).toBe(false);
expect(result).toBe(true);
});
});
});

View file

@ -716,6 +716,9 @@ export class CodebaseIndexer {
public async wasIndexesChanged() {
const indexes = await this.getIndexesToBuild();
if (indexes.length < this.builtIndexes.length) {
return true;
}
return !indexes.every((index) =>
this.builtIndexes.some(
(builtIndex) => builtIndex.artifactId === index.artifactId,