git » sdk » commit a034ccf

mam_by uses empty string to store null too

author Stephen Paul Weber
2025-04-14 18:21:42 UTC
committer Stephen Paul Weber
2025-04-14 18:21:42 UTC
parent b5e025a3e4c8b7df159989f0949ede87d3360ac5

mam_by uses empty string to store null too

since we can't have null in a primary key

snikket/persistence/Sqlite.hx +1 -1

diff --git a/snikket/persistence/Sqlite.hx b/snikket/persistence/Sqlite.hx
index 6acd5e5..2e78f88 100644
--- a/snikket/persistence/Sqlite.hx
+++ b/snikket/persistence/Sqlite.hx
@@ -790,7 +790,7 @@ class Sqlite implements Persistence implements KeyValueStore {
 			builder.type = row.type;
 			builder.senderId = row.sender_id;
 			builder.serverId = row.mam_id == "" ? null : row.mam_id;
-			builder.serverIdBy = row.mam_by;
+			builder.serverIdBy = row.mam_by == "" ? null : row.mam_by;
 			if (builder.direction != row.direction) {
 				builder.direction = row.direction;
 				final replyTo = builder.replyTo;