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:
Самохвалов Андрей Ремович
2026-11-07 09:53:49 +03:00
parent 9e18e2f07c
commit a46a04b866
5 changed files with 166 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class DatabaseTests(unittest.TestCase):
def test_migration_and_unique_username_race(self):
with psycopg.connect(URL) as conn:
versions = conn.execute("SELECT version FROM schema_migrations").fetchall()
self.assertEqual(versions, [(1,), (2,), (3,)])
self.assertEqual(versions, [(1,), (2,), (3,), (9,)])
name = "u_" + uuid4().hex[:16]
def register(_):