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. (cherry picked from commit 386276532730b8758298080b49db63738ca300a4)
This commit is contained in:
@@ -38,7 +38,7 @@ class IdempotencyTests(unittest.TestCase):
|
||||
with psycopg.connect(URL) as conn:
|
||||
count = conn.execute(
|
||||
"SELECT count(*) FROM messages WHERE chat_id=%s AND sender_id=%s AND text=%s",
|
||||
(chat["id"], alice["id"], "same body"),
|
||||
(chat["id"], alice["id"], b"same body"),
|
||||
).fetchone()[0]
|
||||
self.assertEqual(count, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user