diff --git a/mempalace/backends/chroma.py b/mempalace/backends/chroma.py index 5f3540e..ac28f0b 100644 --- a/mempalace/backends/chroma.py +++ b/mempalace/backends/chroma.py @@ -561,12 +561,13 @@ def _fix_blob_seq_ids(palace_path: str) -> None: "Skipped %d sysdb-10-format BLOB seq_id(s) in embeddings (not converting)", skipped, ) - if not safe_rows: - return - updates = [(int.from_bytes(blob, byteorder="big"), rowid) for rowid, blob in safe_rows] - conn.executemany("UPDATE embeddings SET seq_id = ? WHERE rowid = ?", updates) - logger.info("Fixed %d BLOB seq_ids in embeddings", len(updates)) - conn.commit() + if safe_rows: + updates = [ + (int.from_bytes(blob, byteorder="big"), rowid) for rowid, blob in safe_rows + ] + conn.executemany("UPDATE embeddings SET seq_id = ? WHERE rowid = ?", updates) + logger.info("Fixed %d BLOB seq_ids in embeddings", len(updates)) + conn.commit() except Exception: logger.exception("Could not fix BLOB seq_ids in %s", db_path) return diff --git a/tests/test_backends.py b/tests/test_backends.py index 9a609d1..7ff24f9 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -507,6 +507,7 @@ def test_fix_blob_seq_ids_skips_sqlite_when_marker_present(tmp_path): mock_connect.assert_not_called() + # ── quarantine_stale_hnsw ─────────────────────────────────────────────────