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:
Самохвалов Андрей Ремович
2026-11-07 09:53:39 +03:00
parent b3dae2855f
commit 3862765327
7 changed files with 169 additions and 7 deletions
+1 -1
View File
@@ -33,7 +33,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,)])
self.assertEqual(versions, [(1,), (2,), (9,)])
name = "u_" + uuid4().hex[:16]
def register(_):