minor fix to prevent null bytes from breaking sync
Build and Push Containers / build-and-push-app (push) Successful in 1m54s
Build and Push Containers / build-and-push-db (push) Successful in 19s

This commit is contained in:
2026-09-12 22:12:09 -04:00
parent d731169b8b
commit 909c96c7bc
+1 -1
View File
@@ -387,7 +387,7 @@ async def _index_file(
) -> None: ) -> None:
"""Upsert one file: doc row + chunk rows + embeddings, one transaction.""" """Upsert one file: doc row + chunk rows + embeddings, one transaction."""
settings = llm.settings settings = llm.settings
content = full_path.read_text(encoding="utf-8", errors="replace") content = full_path.read_text(encoding="utf-8", errors="replace").replace("\x00", "")
digest = hashlib.sha256(content.encode("utf-8")).hexdigest() digest = hashlib.sha256(content.encode("utf-8")).hexdigest()
doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel)) doc = session.scalar(select(Document).where(Document.source == source, Document.path == rel))
if doc is not None and doc.content_hash == digest: if doc is not None and doc.content_hash == digest: