Skip to content

Commit da8774c

Browse files
authored
fix(chatwoot): corrige erro de duplicação na importação de contatos
Resolve o erro 'ON CONFLICT DO UPDATE command cannot affect row a second time' que ocorria ao importar histórico de contatos duplicados. A correção remove a tentativa de atualizar o campo 'identifier' no ON CONFLICT, já que este campo faz parte da constraint de conflito e não pode ser atualizado. Erro original: - identifier = EXCLUDED.identifier Correção: - updated_at = NOW() Isso permite que contatos duplicados sejam atualizados corretamente sem causar erro.
1 parent 4ae3139 commit da8774c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ChatwootImport {
137137
DO UPDATE SET
138138
name = EXCLUDED.name,
139139
phone_number = EXCLUDED.phone_number,
140-
identifier = EXCLUDED.identifier`;
140+
updated_at = NOW()`;
141141

142142
totalContactsImported += (await pgClient.query(sqlInsert, bindInsert))?.rowCount ?? 0;
143143

0 commit comments

Comments
 (0)