scanAndSyncStorage builds sourcesInQdrant and embeddableFiles in the same pass but only ever checks one direction - is this on-disk file already embedded? It never checks the reverse, so points left behind by a deleted or replaced ZIM just sit in Qdrant forever and keep showing up as search hits for content that doesn't exist anymore. Added a reverse sweep that diffs the two sets and purges anything left in Qdrant with no file backing it. Guarded so it's a no-op when the disk scan comes back empty, so a filesystem hiccup can't get misread as "delete everything." Also has to exclude README.md/docs, since those get embedded by discoverNomadDocs and live outside the kb_uploads/zim paths the scanner actually walks. First pass without that exclusion would have wiped the docs KB on every single sync - caught it by testing against a live install where those sources were already indexed. Verified live: found exactly one real orphan out of 29 indexed sources (an old devdocs_en_bash zim superseded by a newer download), purged it, and left the other 28 - including all the docs - alone. |
||
|---|---|---|
| .. | ||
| eval | ||
| functional | ||
| standalone | ||
| unit | ||
| bootstrap.ts | ||