fix(broker): upsert telegram bridge on reconnect (duplicate key)
Some checks failed
CI / Typecheck (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-09 12:33:02 +01:00
parent bb28e16c7d
commit 8d1685e64d

View File

@@ -4130,6 +4130,9 @@ function main(): void {
displayName: row.displayName, displayName: row.displayName,
chatType: row.chatType, chatType: row.chatType,
chatTitle: row.chatTitle ?? null, 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) => { async (chatId, meshId) => {