You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
qmd update deactivates every document when a collection root is missing (unmounted drive) #989
When a collection's root folder is not there at qmd update time (external drive unmounted, network share offline, folder renamed), every document in that collection is deactivated. qmd search and qmd query return nothing for it, and the command still exits 0 with ✓ All collections updated. If qmd cleanup runs before the folder comes back, the rows and their content are hard-deleted, so the loss is permanent and the next update re-indexes and re-embeds from scratch.
reindexCollection in src/store.ts globs the root with fast-glob, which returns [] for a folder that does not exist. The deactivation pass at the end of the function then treats every active document as deleted. The SDK store.update() goes through the same function.
Suggested fix
Check that the root exists and is a directory before globbing. If it is not, leave the index unchanged and report the collection as not found. A genuinely empty folder should still deactivate everything as it does today.
I have a small fix with a test ready and will open a PR.
Activity
fix(update): leave the index unchanged when a collection root is missing
fix(update): leave the index unchanged when a collection root is missing
docs(changelog): credit tobi#983 and tobi#990
fix(update): leave the index unchanged when a collection root is missing
docs(changelog): credit tobi#983 and tobi#990