fix: ensure the tenant-scoped collection in upsert_document_chunks

ensure_collection() was called with the raw user string while the
upsert targeted get_collection_name(user), creating stray bare-name
collections (e.g. 'test_user') and failing the actual upsert when the
scoped collection did not exist yet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 11:17:36 +02:00
co-authored by Claude Fable 5
parent 2d8cccaeaa
commit 33e62db6a2
+3 -1
View File
@@ -137,7 +137,9 @@ class QdrantClientWrapper:
)
collection_name = self.get_collection_name(user)
await self.ensure_collection(user)
# Ensure the tenant-scoped collection (passing the raw user here used
# to create a stray collection named after the bare user string).
await self.ensure_collection(collection_name)
points = []
for i, (chunk, embedding) in enumerate(zip(chunks, embeddings)):