Skip to content

Qdrant adapter missing _Collection.update() → username rename silently orphans a user's personal RAG docs #166

Description

@jdmanring

Summary

After the ChromaDB->Qdrant migration, a username rename silently orphans all of that user's personal RAG documents — they become unreachable under the new name, with no error surfaced.

Root cause

The Qdrant adapter _Collection (src/vector_client.py) implements add/upsert/delete/get/query/count but not update(). VectorRAG.rename_owner (src/rag_vector.py:325) calls:

collection.update(ids=selected_ids, metadatas=new_metas)

inside a bare except Exception (rag_vector.py:327-329). The missing method raises AttributeError (a subclass of Exception), which is swallowed: failed_count += len(selected_ids), success=False, updated_count stays 0. No crash, no user-visible error.

Under the old ChromaDB backend .update() existed; the migration replaced the client and left the call site. Live path: routes/personal_routes.py / routes/auth_routes.py -> rag_manager.rename_owner(...) on an auth username rename. Because search() filters where={"owner": owner}, the renamed user loses access to every previously-indexed personal document.

Fix

Add update() to _Collection, backed by Qdrant set_payload (a merge — reserved _ID_KEY/_DOC_KEY survive automatically; rename_owner passes a complete user-metadata dict) plus update_vectors for the rare embedding change. Regression tests in tests/test_vector_client_update.py (in-memory Qdrant engine): method exists, metadata rewrite preserves document + id, and the renamed owner becomes reachable by the where={owner} filter while the old owner returns nothing.

Classification

Regression in the Qdrant migration (feat/memory-qdrant-nomic, #161; also live on develop via a097df06). Fix on feat/memory-qdrant-nomic, cherry-picked to develop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions