fix(migration): stop ownerId ping-pong on group DMs with 2 members

migrateFixOneOnOneOwnerIds was too aggressive — it set owner_id=NULL
on any 2-member channel, including group DMs that happened to have 2
members. The group DM repair then restored owner_id, creating noisy
logs every restart.

Now only targets channels with NULL or 32-char hex federatedId
(true 1-on-1 DMs), skipping UUID-format group DMs.
This commit is contained in:
Jannis Braun
2026-04-01 04:00:07 +02:00
parent 91362493ea
commit 73583a4b61
+1
View File
@@ -1993,6 +1993,7 @@ function migrateFixOneOnOneOwnerIds(db: Database.Database): void {
HAVING COUNT(*) = 2
)
AND owner_id IS NOT NULL
AND (federated_id IS NULL OR length(federated_id) = 32)
`).run();
if (result.changes > 0) {