Elffuss BraidHub

kikocis/continue public

Merge pull request #6146 from shssoichiro/issue-6139

fix: do not delete docs indexes on resync
Changeset3cf2411409021d7e85d0e2a7fea3f4e0ea7cd820cc85a30511021856a5ac6e2d
AuthorDallin Romney <dallinromney@gmail.com> · 2025-07-02 14:01 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-02 14:01 -07:00
Parentsc1ef065f0bc4, cd9d848fee39

Browse the files at this changeset

1 file changed

modified core/indexing/docs/DocsService.ts +0 −10
@@ -981,17 +981,11 @@
981981 // Otherwise sync the index based on config changes
982982 const oldConfigDocs = oldConfig?.docs || [];
983983 const newConfigDocs = newConfig.docs || [];
984- const newConfigStartUrls = newConfigDocs.map((doc) => doc.startUrl);
985984
986985 // NOTE since listMetadata filters by embeddings provider id embedding model changes are accounted for here
987986 const currentlyIndexedDocs = await this.listMetadata();
988987 const currentStartUrls = currentlyIndexedDocs.map((doc) => doc.startUrl);
989988
990- // Anything found in sqlite but not in new config should be deleted
991- const deletedDocs = currentlyIndexedDocs.filter(
992- (doc) => !newConfigStartUrls.includes(doc.startUrl),
993- );
994-
995989 // Anything found in old config, new config, AND sqlite that doesn't match should be reindexed
996990 // TODO if only favicon and title change, only update, don't embed
997991 // Otherwise anything found in new config that isn't in sqlite should be added/indexed
@@ -1038,10 +1032,6 @@
10381032 ...changedDocs.map((doc) => this.indexAndAdd(doc, true)),
10391033 ...addedDocs.map((doc) => this.indexAndAdd(doc)),
10401034 ]);
1041-
1042- for (const doc of deletedDocs) {
1043- await this.deleteIndexes(doc.startUrl);
1044- }
10451035 } catch (e) {
10461036 console.error("Error syncing docs index on config update", e);
10471037 } finally {