fix: preserve NUL characters in persisted messages
Store message text as UTF-8 bytes and migrate existing rows without loss. Cover HTTP round trips, restart persistence, Unicode limits and idempotent retries. Adapt direct database tools to the binary storage format.
This commit is contained in:
@@ -47,7 +47,7 @@ def samples(conn, chat_id):
|
||||
"ORDER BY created_at,id OFFSET %s LIMIT 1", (UUID(chat_id), offset)
|
||||
).fetchone()
|
||||
assert row is not None, "benchmark chat must contain 80000 messages"
|
||||
found.append({"id": str(row["id"]), "text_sha256": hashlib.sha256(row["text"].encode()).hexdigest()})
|
||||
found.append({"id": str(row["id"]), "text_sha256": hashlib.sha256(row["text"]).hexdigest()})
|
||||
return found
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user