From c37c2a76284f8ef5ee500e6e262dc621470d7f35 Mon Sep 17 00:00:00 2001 From: "Leon.Schmidt" Date: Wed, 19 Aug 2026 00:25:35 +0200 Subject: [PATCH] FIX - validate migration channel participants Resolve DarkChat participant profiles only after confirming that a source channel contains exactly two members. This lets incomplete and group channels be counted as unsupported while the remaining LB Phone migration domains continue without a nil-index failure. --- sky_phone/source/server/lb_phone_migration.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sky_phone/source/server/lb_phone_migration.lua b/sky_phone/source/server/lb_phone_migration.lua index 7ae734f..dda8234 100644 --- a/sky_phone/source/server/lb_phone_migration.lua +++ b/sky_phone/source/server/lb_phone_migration.lua @@ -2143,11 +2143,13 @@ local function run_dark_chat(dry_run) for index = 1, #channels do local channel = channels[index] local usernames = members_by_channel[tostring(channel.name)] or {} - local first_profile = profile_by_username[usernames[1]:lower()] - local second_profile = profile_by_username[usernames[2]:lower()] - if tonumber(channel.member_count) == 2 and #usernames == 2 - and first_profile and second_profile and first_profile ~= second_profile - then + local first_profile + local second_profile + if tonumber(channel.member_count) == 2 and #usernames == 2 then + first_profile = profile_by_username[usernames[1]:lower()] + second_profile = profile_by_username[usernames[2]:lower()] + end + if first_profile and second_profile and first_profile ~= second_profile then local conversation_id = deterministic_uuid("lb-phone-darkchat-conversation", channel.name) conversation_by_channel[tostring(channel.name)] = conversation_id local first_at = channel.first_at or channel.last_at