From 8d1685e64db20bd98cf5a023d47a12217607cb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Thu, 9 Apr 2026 12:33:02 +0100 Subject: [PATCH] fix(broker): upsert telegram bridge on reconnect (duplicate key) Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/broker/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/broker/src/index.ts b/apps/broker/src/index.ts index e49f6f2..edf323a 100644 --- a/apps/broker/src/index.ts +++ b/apps/broker/src/index.ts @@ -4130,6 +4130,9 @@ function main(): void { displayName: row.displayName, chatType: row.chatType, chatTitle: row.chatTitle ?? null, + }).onConflictDoUpdate({ + target: [telegramBridge.chatId, telegramBridge.meshId], + set: { active: true, disconnectedAt: null, pubkey: row.pubkey, secretKey: row.secretKey, displayName: row.displayName }, }); }, async (chatId, meshId) => {