From 98941c20a0b352dc469eb49072da96d044561fbe Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 12 Nov 2026 23:12:57 +1100 Subject: [PATCH] fix(controlplanestore): legacy channel settings drop the retired models key on migration (#1903) --- .../infrastructure/controlplanestore/telegram_connection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/infrastructure/controlplanestore/telegram_connection.go b/internal/infrastructure/controlplanestore/telegram_connection.go index 9274ac941..eee4468c0 100644 --- a/internal/infrastructure/controlplanestore/telegram_connection.go +++ b/internal/infrastructure/controlplanestore/telegram_connection.go @@ -100,6 +100,9 @@ func splitLegacyChannelSettings(orgID string, stored []byte) (rewritten []byte, return nil, telegramConnection{}, false, fmt.Errorf("decode telegram: %w", err) } delete(doc, "telegram") + // A document old enough to carry telegram can also carry the per-channel + // models that model aliases replaced, which the current schema rejects. + delete(doc, "models") if orgID == storecontract.DefaultOrgID { moved = telegramConnection{Token: legacy.TokenRef, Users: legacy.AllowedUserIDs} } else if len(legacy.AllowedUserIDs) > 0 {