EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
GNU General Public License v3.0
1.42k stars 675 forks source link

[PT][FEAT] Sincronizar mensagens Editadas e receber Figurinhas #472

Closed guibarbas closed 3 months ago

guibarbas commented 6 months ago

Título: [Sincronizar mensagens Editadas e receber Figurinhas]

Descrição Detalhada:

Gostaria de solicitar a implementação de duas novas funcionalidades. A primeira é a capacidade de sincronizar mensagens editadas do Whatsapp em tempo real. Atualmente, a API suporta o envio e recebimento de mensagens, mas não suporta a sincronização de mensagens editadas, o que é um recurso essencial para garantir a consistência das conversas.

A segunda é a capacidade de receber figurinhas (stickers) enviados pelos usuários do Whatsapp.

Racional:

Adicionar esses recursos é crucial para melhorar a experiência do usuário e manter a integridade das conversas. Especialmente para aqueles que estão usando uma integração como o Chatwoot.

Exemplos de Uso:

Como estou citando o Chatwoot, vou usá-lo nos exemplos.

Um usuário envia uma mensagem no Whatsapp e edita essa mensagem. Atualmente, a mensagem editada não é sincronizada com o Chatwoot, o que pode levar a confusão na conversa. Com a nova funcionalidade, as mensagens editadas seriam refletidas corretamente no Chatwoot, facilitando o fluxo de comunicação.

Segundo exemplo: os usuários gostam de se expressar usando figurinhas no Whatsapp. Ao adicionar suporte para receber figurinhas na API Evolution, os agentes do Chatwoot podem interagir de forma mais eficaz com os clientes, aproveitando os figurinhas enviados. Atualmente, ao receber um figurinha, lidamos com um erro ou não relatamos nenhuma mensagem. Isso torna a interação confusa.

Possíveis Implementações:

Para implementar a sincronização de mensagens editadas, pode ser necessário monitorar continuamente as alterações nas mensagens recebidas do Whatsapp e atualizar as mensagens correspondentes no Chatwoot, como foi feito com a opção "excluir mensagens".

Quanto ao recebimento de figurinhas, acredito que seja necessário adicionar suporte para processar e exibir esses tipos específicos de mensagens, manipulando o tipo de arquivo diretamente na API e transmitindo para o Chatwoot.

Neste caso, acredito que a Evolution tratando ambos os casos, podemos avançar com a equipe do Chatwoot, e prosseguir com o mesmo pedido.

Impacto no Projeto:

A adição desses recursos terá um impacto positivo significativo no projeto, melhorando a experiência do usuário e expandindo os recursos da API Evolution.

Notas Adicionais:

Espero que você possa considerar essas solicitações de implementação e que elas possam ajudar muitos usuários, bem como me ajudar.

jaison-x commented 6 months ago

Nesta PR #474 foi adicionada a funcionalidade de exibir edições de mensagens no Chatwoot. Por favor teste e nos envie um feedback:

image

Sobre as figurinhas, elas deveriam funcionar normalmente. Verifique nos logs se aparece algum erro na sua aplicação.

guibarbas commented 6 months ago

Olá @jaison-x, como vai?

Muito obrigado pele rápido retorno.

Realizei vários testes e não consegui identificar o que esta causando este erro. Inclusive, realizei uma nova instalação de todo o ambiente do absoluto zero, e ainda sim, sigo com as falhas.

Abaixo vou enviar os logs e mais detalhes.

Ao testar a edição, ou remoção de mensagens, nenhum log é gerado. Nem dentro do Evo, nem dentro do CW. Aparentemente a ação de edição/remoção, não dispara nenhum tipo de evento para a Evo ou para o CW.

Já quando enviamos as figurinhas, algumas são enviadas normalmente e outras geram o erro que vou destacar abaixo. O estranho é que não consegui diferenciar o motivo pelo qual algumas funcionam e outras não.

2024-03-16T00:34:12.181920443Z [Evolution API] v1.7.0 1 - Fri Mar 15 2024 21:34:12 ERROR [WAStartupService] [object]
2024-03-16T00:34:12.186379877Z AxiosError: getaddrinfo ENOTFOUND web.whatsapp.net 2024-03-16T00:34:12.186423820Z at AxiosError.from (file:///evolution/node_modules/axios/lib/core/AxiosError.js:89:14) 2024-03-16T00:34:12.186427667Z at RedirectableRequest.handleRequestError (file:///evolution/node_modules/axios/lib/adapters/http.js:610:25) 2024-03-16T00:34:12.186430182Z at RedirectableRequest.emit (node:events:514:28) 2024-03-16T00:34:12.186432337Z at RedirectableRequest.emit (node:domain:488:12) 2024-03-16T00:34:12.186434400Z at eventHandlers. (/evolution/node_modules/follow-redirects/index.js:38:24) 2024-03-16T00:34:12.186437146Z at ClientRequest.emit (node:events:514:28) 2024-03-16T00:34:12.186439219Z at ClientRequest.emit (node:domain:488:12) 2024-03-16T00:34:12.186441153Z at TLSSocket.socketErrorListener (node:_http_client:495:9) 2024-03-16T00:34:12.186443467Z at TLSSocket.emit (node:events:514:28) 2024-03-16T00:34:12.186445431Z at TLSSocket.emit (node:domain:488:12) 2024-03-16T00:34:12.186447425Z at Axios.request (file:///evolution/node_modules/axios/lib/core/Axios.js:45:41) 2024-03-16T00:34:12.186449468Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-03-16T00:34:12.186462483Z at async getHttpStream (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:317:21) 2024-03-16T00:34:12.186464937Z at async downloadEncryptedContent (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:450:21) 2024-03-16T00:34:12.186467042Z at async downloadMsg (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:743:24) 2024-03-16T00:34:12.186469075Z at async downloadMediaMessage (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:703:24) { 2024-03-16T00:34:12.186471139Z hostname: 'web.whatsapp.net', 2024-03-16T00:34:12.186473053Z syscall: 'getaddrinfo', 2024-03-16T00:34:12.186474937Z code: 'ENOTFOUND', 2024-03-16T00:34:12.186489094Z errno: -3008, 2024-03-16T00:34:12.186491197Z config: { 2024-03-16T00:34:12.186493101Z transitional: { 2024-03-16T00:34:12.186495015Z silentJSONParsing: true, 2024-03-16T00:34:12.186496939Z forcedJSONParsing: true, 2024-03-16T00:34:12.186498922Z clarifyTimeoutError: false 2024-03-16T00:34:12.186500836Z }, 2024-03-16T00:34:12.186502739Z adapter: [ 'xhr', 'http' ], 2024-03-16T00:34:12.186504673Z transformRequest: [ [Function: transformRequest] ], 2024-03-16T00:34:12.186506637Z transformResponse: [ [Function: transformResponse] ], 2024-03-16T00:34:12.186508641Z timeout: 0, 2024-03-16T00:34:12.186510504Z xsrfCookieName: 'XSRF-TOKEN', 2024-03-16T00:34:12.186512688Z xsrfHeaderName: 'X-XSRF-TOKEN', 2024-03-16T00:34:12.186514612Z maxContentLength: Infinity, 2024-03-16T00:34:12.186516545Z maxBodyLength: Infinity, 2024-03-16T00:34:12.186518479Z env: { FormData: [Function], Blob: [class Blob] }, 2024-03-16T00:34:12.186520433Z validateStatus: [Function: validateStatus], 2024-03-16T00:34:12.186522336Z headers: Object [AxiosHeaders] { 2024-03-16T00:34:12.186524270Z Accept: 'application/json, text/plain, /', 2024-03-16T00:34:12.186527215Z 'Content-Type': undefined, 2024-03-16T00:34:12.186529219Z Origin: 'https://web.whatsapp.com', 2024-03-16T00:34:12.186531152Z 'User-Agent': 'axios/1.6.7', 2024-03-16T00:34:12.186533056Z 'Accept-Encoding': 'gzip, compress, deflate, br' 2024-03-16T00:34:12.186535050Z }, 2024-03-16T00:34:12.186536954Z responseType: 'stream', 2024-03-16T00:34:12.186538888Z method: 'get', 2024-03-16T00:34:12.186540782Z url: 'https://web.whatsapp.net', 2024-03-16T00:34:12.186542706Z data: undefined 2024-03-16T00:34:12.186544599Z }, 2024-03-16T00:34:12.186546502Z request: <ref 1> Writable { 2024-03-16T00:34:12.186551672Z _writableState: WritableState { 2024-03-16T00:34:12.186553766Z objectMode: false, 2024-03-16T00:34:12.186566379Z highWaterMark: 16384, 2024-03-16T00:34:12.186568654Z finalCalled: false, 2024-03-16T00:34:12.186570617Z needDrain: false, 2024-03-16T00:34:12.186572541Z ending: false, 2024-03-16T00:34:12.186574505Z ended: false, 2024-03-16T00:34:12.186576398Z finished: false, 2024-03-16T00:34:12.186578722Z destroyed: false, 2024-03-16T00:34:12.186580806Z decodeStrings: true, 2024-03-16T00:34:12.186582720Z defaultEncoding: 'utf8', 2024-03-16T00:34:12.186584734Z length: 0, 2024-03-16T00:34:12.186586697Z writing: false, 2024-03-16T00:34:12.186588601Z corked: 0, 2024-03-16T00:34:12.186590515Z sync: true, 2024-03-16T00:34:12.186592399Z bufferProcessing: false, 2024-03-16T00:34:12.186594443Z onwrite: [Function: bound onwrite], 2024-03-16T00:34:12.186596366Z writecb: null, 2024-03-16T00:34:12.186598309Z writelen: 0, 2024-03-16T00:34:12.186600204Z afterWriteTickInfo: null, 2024-03-16T00:34:12.186602208Z buffered: [], 2024-03-16T00:34:12.186604112Z bufferedIndex: 0, 2024-03-16T00:34:12.186606055Z allBuffers: true, 2024-03-16T00:34:12.186607949Z allNoop: true, 2024-03-16T00:34:12.186609842Z pendingcb: 0, 2024-03-16T00:34:12.186611836Z constructed: true, 2024-03-16T00:34:12.186613720Z prefinished: false, 2024-03-16T00:34:12.186615633Z errorEmitted: false, 2024-03-16T00:34:12.186617577Z emitClose: true, 2024-03-16T00:34:12.186619480Z autoDestroy: true, 2024-03-16T00:34:12.186621394Z errored: null, 2024-03-16T00:34:12.186623287Z closed: false, 2024-03-16T00:34:12.186625201Z closeEmitted: false, 2024-03-16T00:34:12.186627105Z [Symbol(kOnFinished)]: [] 2024-03-16T00:34:12.186629008Z }, 2024-03-16T00:34:12.186630892Z _events: [Object: null prototype] { 2024-03-16T00:34:12.186632855Z response: [Function: handleResponse], 2024-03-16T00:34:12.186654065Z error: [Function: handleRequestError], 2024-03-16T00:34:12.186656139Z socket: [Function: handleRequestSocket] 2024-03-16T00:34:12.186658093Z }, 2024-03-16T00:34:12.186659976Z _eventsCount: 3, 2024-03-16T00:34:12.186661840Z _maxListeners: undefined, 2024-03-16T00:34:12.186663804Z _options: { 2024-03-16T00:34:12.186668733Z maxRedirects: 21, 2024-03-16T00:34:12.186670828Z maxBodyLength: Infinity, 2024-03-16T00:34:12.186672771Z protocol: 'https:', 2024-03-16T00:34:12.186674675Z path: '/', 2024-03-16T00:34:12.186676578Z method: 'GET', 2024-03-16T00:34:12.186678482Z headers: [Object: null prototype], 2024-03-16T00:34:12.186680416Z agents: [Object], 2024-03-16T00:34:12.186682309Z auth: undefined, 2024-03-16T00:34:12.186684463Z family: undefined, 2024-03-16T00:34:12.186686467Z beforeRedirect: [Function: dispatchBeforeRedirect], 2024-03-16T00:34:12.186688490Z beforeRedirects: [Object], 2024-03-16T00:34:12.186692108Z hostname: 'web.whatsapp.net', 2024-03-16T00:34:12.186694091Z port: '', 2024-03-16T00:34:12.186695995Z agent: undefined, 2024-03-16T00:34:12.186697888Z nativeProtocols: [Object], 2024-03-16T00:34:12.186699852Z pathname: '/' 2024-03-16T00:34:12.186701736Z }, 2024-03-16T00:34:12.186703649Z _ended: true, 2024-03-16T00:34:12.186705553Z _ending: true, 2024-03-16T00:34:12.186707406Z _redirectCount: 0, 2024-03-16T00:34:12.186709300Z _redirects: [], 2024-03-16T00:34:12.186721232Z _requestBodyLength: 0, 2024-03-16T00:34:12.186723768Z _requestBodyBuffers: [], 2024-03-16T00:34:12.186725751Z _onNativeResponse: [Function (anonymous)], 2024-03-16T00:34:12.186728036Z _currentRequest: ClientRequest { 2024-03-16T00:34:12.186730039Z _events: [Object: null prototype], 2024-03-16T00:34:12.186732314Z _eventsCount: 7, 2024-03-16T00:34:12.186734327Z _maxListeners: undefined, 2024-03-16T00:34:12.186736231Z outputData: [], 2024-03-16T00:34:12.186738115Z outputSize: 0, 2024-03-16T00:34:12.186740008Z writable: true, 2024-03-16T00:34:12.186741932Z destroyed: false, 2024-03-16T00:34:12.186743815Z _last: true, 2024-03-16T00:34:12.186745739Z chunkedEncoding: false, 2024-03-16T00:34:12.186747642Z shouldKeepAlive: true, 2024-03-16T00:34:12.186749626Z maxRequestsOnConnectionReached: false, 2024-03-16T00:34:12.186751550Z _defaultKeepAlive: true, 2024-03-16T00:34:12.186753514Z useChunkedEncodingByDefault: false, 2024-03-16T00:34:12.186755417Z sendDate: false, 2024-03-16T00:34:12.186757311Z _removedConnection: false, 2024-03-16T00:34:12.186759224Z _removedContLen: false, 2024-03-16T00:34:12.186761128Z _removedTE: false, 2024-03-16T00:34:12.186765716Z strictContentLength: false, 2024-03-16T00:34:12.186767780Z _contentLength: 0, 2024-03-16T00:34:12.186769664Z _hasBody: true, 2024-03-16T00:34:12.186771538Z _trailer: '', 2024-03-16T00:34:12.186773421Z finished: true, 2024-03-16T00:34:12.186775294Z _headerSent: true, 2024-03-16T00:34:12.186777188Z _closed: false, 2024-03-16T00:34:12.186779112Z socket: [TLSSocket], 2024-03-16T00:34:12.186781025Z _header: 'GET / HTTP/1.1\r\n' + 2024-03-16T00:34:12.186783099Z 'Accept: application/json, text/plain, /\r\n' + 2024-03-16T00:34:12.186785133Z 'Origin: https://web.whatsapp.com\r\n' + 2024-03-16T00:34:12.186787138Z 'User-Agent: axios/1.6.7\r\n' + 2024-03-16T00:34:12.186789081Z 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 2024-03-16T00:34:12.186808488Z 'Host: web.whatsapp.net\r\n' + 2024-03-16T00:34:12.186810502Z 'Connection: keep-alive\r\n' + 2024-03-16T00:34:12.186812465Z '\r\n', 2024-03-16T00:34:12.186814579Z _keepAliveTimeout: 0, 2024-03-16T00:34:12.186816583Z _onPendingData: [Function: nop], 2024-03-16T00:34:12.186818656Z agent: [Agent], 2024-03-16T00:34:12.186820641Z socketPath: undefined, 2024-03-16T00:34:12.186822554Z method: 'GET', 2024-03-16T00:34:12.186824457Z maxHeaderSize: undefined, 2024-03-16T00:34:12.186826391Z insecureHTTPParser: undefined, 2024-03-16T00:34:12.186828345Z joinDuplicateHeaders: undefined, 2024-03-16T00:34:12.186830318Z path: '/', 2024-03-16T00:34:12.186832252Z _ended: false, 2024-03-16T00:34:12.186834165Z res: null, 2024-03-16T00:34:12.186836060Z aborted: false, 2024-03-16T00:34:12.186837983Z timeoutCb: [Function: emitRequestTimeout], 2024-03-16T00:34:12.186839926Z upgradeOrConnect: false, 2024-03-16T00:34:12.186841830Z parser: null, 2024-03-16T00:34:12.186843754Z maxHeadersCount: null, 2024-03-16T00:34:12.186845678Z reusedSocket: false, 2024-03-16T00:34:12.186847581Z host: 'web.whatsapp.net', 2024-03-16T00:34:12.186849505Z protocol: 'https:', 2024-03-16T00:34:12.186851439Z _redirectable: [Circular 1], 2024-03-16T00:34:12.186853383Z [Symbol(kCapture)]: false, 2024-03-16T00:34:12.186855326Z [Symbol(kBytesWritten)]: 0, 2024-03-16T00:34:12.186857270Z [Symbol(kNeedDrain)]: false, 2024-03-16T00:34:12.186859244Z [Symbol(corked)]: 0, 2024-03-16T00:34:12.186861157Z [Symbol(kOutHeaders)]: [Object: null prototype], 2024-03-16T00:34:12.186865646Z [Symbol(errored)]: null, 2024-03-16T00:34:12.186877588Z [Symbol(kHighWaterMark)]: 16384, 2024-03-16T00:34:12.186880153Z [Symbol(kRejectNonStandardBodyWrites)]: false, 2024-03-16T00:34:12.186882136Z [Symbol(kUniqueHeaders)]: null 2024-03-16T00:34:12.186884080Z }, 2024-03-16T00:34:12.186886024Z _currentUrl: 'https://web.whatsapp.net/', 2024-03-16T00:34:12.186888008Z [Symbol(kCapture)]: false 2024-03-16T00:34:12.186890372Z }, 2024-03-16T00:34:12.186892346Z cause: Error: getaddrinfo ENOTFOUND web.whatsapp.net 2024-03-16T00:34:12.186894319Z at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { 2024-03-16T00:34:12.186896313Z errno: -3008, 2024-03-16T00:34:12.186898187Z code: 'ENOTFOUND', 2024-03-16T00:34:12.186900050Z syscall: 'getaddrinfo', 2024-03-16T00:34:12.186902044Z hostname: 'web.whatsapp.net' 2024-03-16T00:34:12.186903988Z } 2024-03-16T00:34:12.186905851Z } 2024-03-16T00:34:12.186907744Z 2024-03-16T00:34:12.186909738Z [Evolution API] v1.7.0 1 - Fri Mar 15 2024 21:34:12 ERROR [ChatwootService] [object]
2024-03-16T00:34:12.186912875Z { 2024-03-16T00:34:12.186914799Z status: 400, 2024-03-16T00:34:12.186916722Z error: 'Bad Request', 2024-03-16T00:34:12.186918657Z message: [ 'Error: getaddrinfo ENOTFOUND web.whatsapp.net' ] 2024-03-16T00:34:12.186920660Z }

Para detalhar melhor meu ambiente, estou usando a versão Latest da Evo e da CW, oficiais. Evo conectada ao Mongo e Redis. CW com instalação padrão no Postgres e Redis

Estou usando o PGBoucer também, contudo realizei um teste passando por ele e fora dele.

Abaixo, estou enviando as Environment que utilizei (ocultando apenas os dados sensíveis), caso precise avaliar. SERVER_URL=https:// DOCKER_ENV=true LOG_LEVEL=ERROR,WARN LOG_COLOR=true DEL_INSTANCE=false CONFIG_SESSION_PHONE_CLIENT=Name CONFIG_SESSION_PHONE_NAME=chrome STORE_MESSAGES=true STORE_MESSAGE_UP=true STORE_CONTACTS=true STORE_CHATS=true CLEAN_STORE_CLEANING_INTERVAL=7200 CLEAN_STORE_MESSAGES=true CLEAN_STORE_MESSAGE_UP=true CLEAN_STORE_CONTACTS=true CLEAN_STORE_CHATS=true AUTHENTICATION_TYPE=apikey AUTHENTICATION_API_KEY=KEY AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true QRCODE_LIMIT=30 WEBHOOK_GLOBAL_ENABLED=false WEBHOOK_GLOBAL_URL=https://URL WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false WEBHOOK_EVENTS_APPLICATION_STARTUP=false WEBHOOK_EVENTS_QRCODE_UPDATED=true WEBHOOK_EVENTS_MESSAGES_SET=false WEBHOOK_EVENTS_MESSAGES_UPSERT=true WEBHOOK_EVENTS_MESSAGES_UPDATE=true WEBHOOK_EVENTS_MESSAGES_DELETE=true WEBHOOK_EVENTS_SEND_MESSAGE=true WEBHOOK_EVENTS_CONTACTS_SET=true WEBHOOK_EVENTS_CONTACTS_UPSERT=true WEBHOOK_EVENTS_CONTACTS_UPDATE=true WEBHOOK_EVENTS_PRESENCE_UPDATE=true WEBHOOK_EVENTS_CHATS_SET=true WEBHOOK_EVENTS_CHATS_UPSERT=true WEBHOOK_EVENTS_CHATS_UPDATE=true WEBHOOK_EVENTS_CHATS_DELETE=true WEBHOOK_EVENTS_GROUPS_UPSERT=true WEBHOOK_EVENTS_GROUPS_UPDATE=true WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true WEBHOOK_EVENTS_CONNECTION_UPDATE=true WEBHOOK_EVENTS_LABELS_EDIT=true WEBHOOK_EVENTS_LABELS_ASSOCIATION=true WEBHOOK_EVENTS_CALL=true WEBHOOK_EVENTS_ERRORS=false WEBHOOK_EVENTS_ERRORS_WEBHOOK=https://webhook.com.br WEBHOOK_EVENTS_TYPEBOT_START=false WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false REDIS_ENABLED=true REDIS_URI=redis://redis:6379 REDIS_PREFIX_KEY=evdocker RABBITMQ_ENABLED=false DATABASE_ENABLED=true DATABASE_CONNECTION_URI=mongodb://user:pass@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker DATABASE_SAVE_DATA_INSTANCE=true DATABASE_SAVE_DATA_NEW_MESSAGE=true DATABASE_SAVE_MESSAGE_UPDATE=true DATABASE_SAVE_DATA_CONTACTS=true DATABASE_SAVE_DATA_CHATS=true
TYPEBOT_API_VERSION=latest TYPEBOT_KEEP_OPEN=false TOKEN_WEBHOOK=evolution URL=https://graph.facebook.com VERSION=v18.0 LANGUAGE=pt_BR CHATWOOT_MESSAGE_DELETE=true CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgres://user:pass@host:5432/chatwoot CHATWOOT_IMPORT_DATABASE_PLACEHOLDER_MEDIA_MESSAGE=true

Aqui os prints do Whats e CW Dash Chatwoot Dash Whats

Por fim, aqui também, esta o log que recebo ao iniciar a instância da Evo. 2024-03-16T00:26:52.579321393Z (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode 2024-03-16T00:26:52.579379162Z on September 8, 2024 and reach end-of-support on September 8, 2025. 2024-03-16T00:26:52.579384613Z 2024-03-16T00:26:52.579387268Z Please migrate your code to use AWS SDK for JavaScript (v3). 2024-03-16T00:26:52.579389442Z For more information, check blog post at https://a.co/cUPnyil 2024-03-16T00:26:52.579391506Z (Use node --trace-warnings ... to show where the warning was created) 2024-03-16T00:26:54.827702096Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:26:56.754707528Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:26:58.391935148Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:27:00.020209581Z 2024/03/15 09:27PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out

Espero que isso possa ajudar a entender melhor o que possa estar ocorrendo.

jaison-x commented 6 months ago

Olá @jaison-x, como vai?

Muito obrigado pele rápido retorno.

Realizei vários testes e não consegui identificar o que esta causando este erro. Inclusive, realizei uma nova instalação de todo o ambiente do absoluto zero, e ainda sim, sigo com as falhas.

Abaixo vou enviar os logs e mais detalhes.

Ao testar a edição, ou remoção de mensagens, nenhum log é gerado. Nem dentro do Evo, nem dentro do CW. Aparentemente a ação de edição/remoção, não dispara nenhum tipo de evento para a Evo ou para o CW.

Já quando enviamos as figurinhas, algumas são enviadas normalmente e outras geram o erro que vou destacar abaixo. O estranho é que não consegui diferenciar o motivo pelo qual algumas funcionam e outras não.

2024-03-16T00:34:12.181920443Z [Evolution API] v1.7.0 1 - Fri Mar 15 2024 21:34:12 ERROR [WAStartupService] [object] 2024-03-16T00:34:12.186379877Z AxiosError: getaddrinfo ENOTFOUND web.whatsapp.net 2024-03-16T00:34:12.186423820Z at AxiosError.from (file:///evolution/node_modules/axios/lib/core/AxiosError.js:89:14) 2024-03-16T00:34:12.186427667Z at RedirectableRequest.handleRequestError (file:///evolution/node_modules/axios/lib/adapters/http.js:610:25) 2024-03-16T00:34:12.186430182Z at RedirectableRequest.emit (node:events:514:28) 2024-03-16T00:34:12.186432337Z at RedirectableRequest.emit (node:domain:488:12) 2024-03-16T00:34:12.186434400Z at eventHandlers. (/evolution/node_modules/follow-redirects/index.js:38:24) 2024-03-16T00:34:12.186437146Z at ClientRequest.emit (node:events:514:28) 2024-03-16T00:34:12.186439219Z at ClientRequest.emit (node:domain:488:12) 2024-03-16T00:34:12.186441153Z at TLSSocket.socketErrorListener (node:_http_client:495:9) 2024-03-16T00:34:12.186443467Z at TLSSocket.emit (node:events:514:28) 2024-03-16T00:34:12.186445431Z at TLSSocket.emit (node:domain:488:12) 2024-03-16T00:34:12.186447425Z at Axios.request (file:///evolution/node_modules/axios/lib/core/Axios.js:45:41) 2024-03-16T00:34:12.186449468Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-03-16T00:34:12.186462483Z at async getHttpStream (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:317:21) 2024-03-16T00:34:12.186464937Z at async downloadEncryptedContent (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:450:21) 2024-03-16T00:34:12.186467042Z at async downloadMsg (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:743:24) 2024-03-16T00:34:12.186469075Z at async downloadMediaMessage (/evolution/nodemodules/@whiskeysockets/baileys/lib/Utils/messages.js:703:24) { 2024-03-16T00:34:12.186471139Z hostname: 'web.whatsapp.net', 2024-03-16T00:34:12.186473053Z syscall: 'getaddrinfo', 2024-03-16T00:34:12.186474937Z code: 'ENOTFOUND', 2024-03-16T00:34:12.186489094Z errno: -3008, 2024-03-16T00:34:12.186491197Z config: { 2024-03-16T00:34:12.186493101Z transitional: { 2024-03-16T00:34:12.186495015Z silentJSONParsing: true, 2024-03-16T00:34:12.186496939Z forcedJSONParsing: true, 2024-03-16T00:34:12.186498922Z clarifyTimeoutError: false 2024-03-16T00:34:12.186500836Z }, 2024-03-16T00:34:12.186502739Z adapter: [ 'xhr', 'http' ], 2024-03-16T00:34:12.186504673Z transformRequest: [ [Function: transformRequest] ], 2024-03-16T00:34:12.186506637Z transformResponse: [ [Function: transformResponse] ], 2024-03-16T00:34:12.186508641Z timeout: 0, 2024-03-16T00:34:12.186510504Z xsrfCookieName: 'XSRF-TOKEN', 2024-03-16T00:34:12.186512688Z xsrfHeaderName: 'X-XSRF-TOKEN', 2024-03-16T00:34:12.186514612Z maxContentLength: Infinity, 2024-03-16T00:34:12.186516545Z maxBodyLength: Infinity, 2024-03-16T00:34:12.186518479Z env: { FormData: [Function], Blob: [class Blob] }, 2024-03-16T00:34:12.186520433Z validateStatus: [Function: validateStatus], 2024-03-16T00:34:12.186522336Z headers: Object [AxiosHeaders] { 2024-03-16T00:34:12.186524270Z Accept: 'application/json, text/plain, /_', 2024-03-16T00:34:12.186527215Z 'Content-Type': undefined, 2024-03-16T00:34:12.186529219Z Origin: 'https://web.whatsapp.com', 2024-03-16T00:34:12.186531152Z 'User-Agent': 'axios/1.6.7', 2024-03-16T00:34:12.186533056Z 'Accept-Encoding': 'gzip, compress, deflate, br' 2024-03-16T00:34:12.186535050Z }, 2024-03-16T00:34:12.186536954Z responseType: 'stream', 2024-03-16T00:34:12.186538888Z method: 'get', 2024-03-16T00:34:12.186540782Z url: 'https://web.whatsapp.net', 2024-03-16T00:34:12.186542706Z data: undefined 2024-03-16T00:34:12.186544599Z }, 2024-03-16T00:34:12.186546502Z request: <ref 1> Writable { 2024-03-16T00:34:12.186551672Z _writableState: WritableState { 2024-03-16T00:34:12.186553766Z objectMode: false, 2024-03-16T00:34:12.186566379Z highWaterMark: 16384, 2024-03-16T00:34:12.186568654Z finalCalled: false, 2024-03-16T00:34:12.186570617Z needDrain: false, 2024-03-16T00:34:12.186572541Z ending: false, 2024-03-16T00:34:12.186574505Z ended: false, 2024-03-16T00:34:12.186576398Z finished: false, 2024-03-16T00:34:12.186578722Z destroyed: false, 2024-03-16T00:34:12.186580806Z decodeStrings: true, 2024-03-16T00:34:12.186582720Z defaultEncoding: 'utf8', 2024-03-16T00:34:12.186584734Z length: 0, 2024-03-16T00:34:12.186586697Z writing: false, 2024-03-16T00:34:12.186588601Z corked: 0, 2024-03-16T00:34:12.186590515Z sync: true, 2024-03-16T00:34:12.186592399Z bufferProcessing: false, 2024-03-16T00:34:12.186594443Z onwrite: [Function: bound onwrite], 2024-03-16T00:34:12.186596366Z writecb: null, 2024-03-16T00:34:12.186598309Z writelen: 0, 2024-03-16T00:34:12.186600204Z afterWriteTickInfo: null, 2024-03-16T00:34:12.186602208Z buffered: [], 2024-03-16T00:34:12.186604112Z bufferedIndex: 0, 2024-03-16T00:34:12.186606055Z allBuffers: true, 2024-03-16T00:34:12.186607949Z allNoop: true, 2024-03-16T00:34:12.186609842Z pendingcb: 0, 2024-03-16T00:34:12.186611836Z constructed: true, 2024-03-16T00:34:12.186613720Z prefinished: false, 2024-03-16T00:34:12.186615633Z errorEmitted: false, 2024-03-16T00:34:12.186617577Z emitClose: true, 2024-03-16T00:34:12.186619480Z autoDestroy: true, 2024-03-16T00:34:12.186621394Z errored: null, 2024-03-16T00:34:12.186623287Z closed: false, 2024-03-16T00:34:12.186625201Z closeEmitted: false, 2024-03-16T00:34:12.186627105Z [Symbol(kOnFinished)]: [] 2024-03-16T00:34:12.186629008Z }, 2024-03-16T00:34:12.186630892Z _events: [Object: null prototype] { 2024-03-16T00:34:12.186632855Z response: [Function: handleResponse], 2024-03-16T00:34:12.186654065Z error: [Function: handleRequestError], 2024-03-16T00:34:12.186656139Z socket: [Function: handleRequestSocket] 2024-03-16T00:34:12.186658093Z }, 2024-03-16T00:34:12.186659976Z _eventsCount: 3, 2024-03-16T00:34:12.186661840Z _maxListeners: undefined, 2024-03-16T00:34:12.186663804Z _options: { 2024-03-16T00:34:12.186668733Z maxRedirects: 21, 2024-03-16T00:34:12.186670828Z maxBodyLength: Infinity, 2024-03-16T00:34:12.186672771Z protocol: 'https:', 2024-03-16T00:34:12.186674675Z path: '/', 2024-03-16T00:34:12.186676578Z method: 'GET', 2024-03-16T00:34:12.186678482Z headers: [Object: null prototype], 2024-03-16T00:34:12.186680416Z agents: [Object], 2024-03-16T00:34:12.186682309Z auth: undefined, 2024-03-16T00:34:12.186684463Z family: undefined, 2024-03-16T00:34:12.186686467Z beforeRedirect: [Function: dispatchBeforeRedirect], 2024-03-16T00:34:12.186688490Z beforeRedirects: [Object], 2024-03-16T00:34:12.186692108Z hostname: 'web.whatsapp.net', 2024-03-16T00:34:12.186694091Z port: '', 2024-03-16T00:34:12.186695995Z agent: undefined, 2024-03-16T00:34:12.186697888Z nativeProtocols: [Object], 2024-03-16T00:34:12.186699852Z pathname: '/' 2024-03-16T00:34:12.186701736Z }, 2024-03-16T00:34:12.186703649Z _ended: true, 2024-03-16T00:34:12.186705553Z _ending: true, 2024-03-16T00:34:12.186707406Z _redirectCount: 0, 2024-03-16T00:34:12.186709300Z _redirects: [], 2024-03-16T00:34:12.186721232Z _requestBodyLength: 0, 2024-03-16T00:34:12.186723768Z _requestBodyBuffers: [], 2024-03-16T00:34:12.186725751Z _onNativeResponse: [Function (anonymous)], 2024-03-16T00:34:12.186728036Z _currentRequest: ClientRequest { 2024-03-16T00:34:12.186730039Z _events: [Object: null prototype], 2024-03-16T00:34:12.186732314Z _eventsCount: 7, 2024-03-16T00:34:12.186734327Z _maxListeners: undefined, 2024-03-16T00:34:12.186736231Z outputData: [], 2024-03-16T00:34:12.186738115Z outputSize: 0, 2024-03-16T00:34:12.186740008Z writable: true, 2024-03-16T00:34:12.186741932Z destroyed: false, 2024-03-16T00:34:12.186743815Z _last: true, 2024-03-16T00:34:12.186745739Z chunkedEncoding: false, 2024-03-16T00:34:12.186747642Z shouldKeepAlive: true, 2024-03-16T00:34:12.186749626Z maxRequestsOnConnectionReached: false, 2024-03-16T00:34:12.186751550Z _defaultKeepAlive: true, 2024-03-16T00:34:12.186753514Z useChunkedEncodingByDefault: false, 2024-03-16T00:34:12.186755417Z sendDate: false, 2024-03-16T00:34:12.186757311Z _removedConnection: false, 2024-03-16T00:34:12.186759224Z _removedContLen: false, 2024-03-16T00:34:12.186761128Z _removedTE: false, 2024-03-16T00:34:12.186765716Z strictContentLength: false, 2024-03-16T00:34:12.186767780Z _contentLength: 0, 2024-03-16T00:34:12.186769664Z _hasBody: true, 2024-03-16T00:34:12.186771538Z _trailer: '', 2024-03-16T00:34:12.186773421Z finished: true, 2024-03-16T00:34:12.186775294Z _headerSent: true, 2024-03-16T00:34:12.186777188Z _closed: false, 2024-03-16T00:34:12.186779112Z socket: [TLSSocket], 2024-03-16T00:34:12.186781025Z header: 'GET / HTTP/1.1\r\n' + 2024-03-16T00:34:12.186783099Z 'Accept: application/json, text/plain, /_\r\n' + 2024-03-16T00:34:12.186785133Z 'Origin: https://web.whatsapp.com\r\n' + 2024-03-16T00:34:12.186787138Z 'User-Agent: axios/1.6.7\r\n' + 2024-03-16T00:34:12.186789081Z 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 2024-03-16T00:34:12.186808488Z 'Host: web.whatsapp.net\r\n' + 2024-03-16T00:34:12.186810502Z 'Connection: keep-alive\r\n' + 2024-03-16T00:34:12.186812465Z '\r\n', 2024-03-16T00:34:12.186814579Z _keepAliveTimeout: 0, 2024-03-16T00:34:12.186816583Z _onPendingData: [Function: nop], 2024-03-16T00:34:12.186818656Z agent: [Agent], 2024-03-16T00:34:12.186820641Z socketPath: undefined, 2024-03-16T00:34:12.186822554Z method: 'GET', 2024-03-16T00:34:12.186824457Z maxHeaderSize: undefined, 2024-03-16T00:34:12.186826391Z insecureHTTPParser: undefined, 2024-03-16T00:34:12.186828345Z joinDuplicateHeaders: undefined, 2024-03-16T00:34:12.186830318Z path: '/', 2024-03-16T00:34:12.186832252Z _ended: false, 2024-03-16T00:34:12.186834165Z res: null, 2024-03-16T00:34:12.186836060Z aborted: false, 2024-03-16T00:34:12.186837983Z timeoutCb: [Function: emitRequestTimeout], 2024-03-16T00:34:12.186839926Z upgradeOrConnect: false, 2024-03-16T00:34:12.186841830Z parser: null, 2024-03-16T00:34:12.186843754Z maxHeadersCount: null, 2024-03-16T00:34:12.186845678Z reusedSocket: false, 2024-03-16T00:34:12.186847581Z host: 'web.whatsapp.net', 2024-03-16T00:34:12.186849505Z protocol: 'https:', 2024-03-16T00:34:12.186851439Z _redirectable: [Circular 1], 2024-03-16T00:34:12.186853383Z [Symbol(kCapture)]: false, 2024-03-16T00:34:12.186855326Z [Symbol(kBytesWritten)]: 0, 2024-03-16T00:34:12.186857270Z [Symbol(kNeedDrain)]: false, 2024-03-16T00:34:12.186859244Z [Symbol(corked)]: 0, 2024-03-16T00:34:12.186861157Z [Symbol(kOutHeaders)]: [Object: null prototype], 2024-03-16T00:34:12.186865646Z [Symbol(errored)]: null, 2024-03-16T00:34:12.186877588Z [Symbol(kHighWaterMark)]: 16384, 2024-03-16T00:34:12.186880153Z [Symbol(kRejectNonStandardBodyWrites)]: false, 2024-03-16T00:34:12.186882136Z [Symbol(kUniqueHeaders)]: null 2024-03-16T00:34:12.186884080Z }, 2024-03-16T00:34:12.186886024Z _currentUrl: 'https://web.whatsapp.net/', 2024-03-16T00:34:12.186888008Z [Symbol(kCapture)]: false 2024-03-16T00:34:12.186890372Z }, 2024-03-16T00:34:12.186892346Z cause: Error: getaddrinfo ENOTFOUND web.whatsapp.net 2024-03-16T00:34:12.186894319Z at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { 2024-03-16T00:34:12.186896313Z errno: -3008, 2024-03-16T00:34:12.186898187Z code: 'ENOTFOUND', 2024-03-16T00:34:12.186900050Z syscall: 'getaddrinfo', 2024-03-16T00:34:12.186902044Z hostname: 'web.whatsapp.net' 2024-03-16T00:34:12.186903988Z } 2024-03-16T00:34:12.186905851Z } 2024-03-16T00:34:12.186907744Z 2024-03-16T00:34:12.186909738Z [Evolution API] v1.7.0 1 - Fri Mar 15 2024 21:34:12 ERROR [ChatwootService] [object] 2024-03-16T00:34:12.186912875Z { 2024-03-16T00:34:12.186914799Z status: 400, 2024-03-16T00:34:12.186916722Z error: 'Bad Request', 2024-03-16T00:34:12.186918657Z message: [ 'Error: getaddrinfo ENOTFOUND web.whatsapp.net' ] 2024-03-16T00:34:12.186920660Z }

Para detalhar melhor meu ambiente, estou usando a versão Latest da Evo e da CW, oficiais. Evo conectada ao Mongo e Redis. CW com instalação padrão no Postgres e Redis

Estou usando o PGBoucer também, contudo realizei um teste passando por ele e fora dele.

Abaixo, estou enviando as Environment que utilizei (ocultando apenas os dados sensíveis), caso precise avaliar. SERVER_URL=https:// DOCKER_ENV=true LOG_LEVEL=ERROR,WARN LOG_COLOR=true DEL_INSTANCE=false CONFIG_SESSION_PHONE_CLIENT=Name CONFIG_SESSION_PHONE_NAME=chrome STORE_MESSAGES=true STORE_MESSAGE_UP=true STORE_CONTACTS=true STORE_CHATS=true CLEAN_STORE_CLEANING_INTERVAL=7200 CLEAN_STORE_MESSAGES=true CLEAN_STORE_MESSAGE_UP=true CLEAN_STORE_CONTACTS=true CLEAN_STORE_CHATS=true AUTHENTICATION_TYPE=apikey AUTHENTICATION_API_KEY=KEY AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true QRCODE_LIMIT=30 WEBHOOK_GLOBAL_ENABLED=false WEBHOOK_GLOBAL_URL=https://URL WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false WEBHOOK_EVENTS_APPLICATION_STARTUP=false WEBHOOK_EVENTS_QRCODE_UPDATED=true WEBHOOK_EVENTS_MESSAGES_SET=false WEBHOOK_EVENTS_MESSAGES_UPSERT=true WEBHOOK_EVENTS_MESSAGES_UPDATE=true WEBHOOK_EVENTS_MESSAGES_DELETE=true WEBHOOK_EVENTS_SEND_MESSAGE=true WEBHOOK_EVENTS_CONTACTS_SET=true WEBHOOK_EVENTS_CONTACTS_UPSERT=true WEBHOOK_EVENTS_CONTACTS_UPDATE=true WEBHOOK_EVENTS_PRESENCE_UPDATE=true WEBHOOK_EVENTS_CHATS_SET=true WEBHOOK_EVENTS_CHATS_UPSERT=true WEBHOOK_EVENTS_CHATS_UPDATE=true WEBHOOK_EVENTS_CHATS_DELETE=true WEBHOOK_EVENTS_GROUPS_UPSERT=true WEBHOOK_EVENTS_GROUPS_UPDATE=true WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true WEBHOOK_EVENTS_CONNECTION_UPDATE=true WEBHOOK_EVENTS_LABELS_EDIT=true WEBHOOK_EVENTS_LABELS_ASSOCIATION=true WEBHOOK_EVENTS_CALL=true WEBHOOK_EVENTS_ERRORS=false WEBHOOK_EVENTS_ERRORS_WEBHOOK=https://webhook.com.br WEBHOOK_EVENTS_TYPEBOT_START=false WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false REDIS_ENABLED=true REDIS_URI=redis://redis:6379 REDIS_PREFIX_KEY=evdocker RABBITMQ_ENABLED=false DATABASE_ENABLED=true DATABASE_CONNECTION_URI=mongodb://user:pass@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker DATABASE_SAVE_DATA_INSTANCE=true DATABASE_SAVE_DATA_NEW_MESSAGE=true DATABASE_SAVE_MESSAGE_UPDATE=true DATABASE_SAVE_DATA_CONTACTS=true DATABASE_SAVE_DATA_CHATS=true TYPEBOT_API_VERSION=latest TYPEBOT_KEEP_OPEN=false TOKEN_WEBHOOK=evolution URL=https://graph.facebook.com VERSION=v18.0 LANGUAGE=pt_BR CHATWOOT_MESSAGE_DELETE=true CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgres://user:pass@host:5432/chatwoot CHATWOOT_IMPORT_DATABASE_PLACEHOLDER_MEDIA_MESSAGE=true

Aqui os prints do Whats e CW Dash Chatwoot Dash Whats

Por fim, aqui também, esta o log que recebo ao iniciar a instância da Evo. 2024-03-16T00:26:52.579321393Z (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode 2024-03-16T00:26:52.579379162Z on September 8, 2024 and reach end-of-support on September 8, 2025. 2024-03-16T00:26:52.579384613Z 2024-03-16T00:26:52.579387268Z Please migrate your code to use AWS SDK for JavaScript (v3). 2024-03-16T00:26:52.579389442Z For more information, check blog post at https://a.co/cUPnyil 2024-03-16T00:26:52.579391506Z (Use node --trace-warnings ... to show where the warning was created) 2024-03-16T00:26:54.827702096Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:26:56.754707528Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:26:58.391935148Z 2024/03/15 09:26PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out 2024-03-16T00:27:00.020209581Z 2024/03/15 09:27PM 50 pid=1 hostname=5acf8619aa3f node={"tag":"stream:error","attrs":{},"content":[{"tag":"conflict","attrs":{"type":"replaced"}}]} msg=stream errored out

Espero que isso possa ajudar a entender melhor o que possa estar ocorrendo.

Está usando com o mongodb ativado? Estas funções precisam do mongo para funcionar corretamente.

guibarbas commented 5 months ago

Olá @jaison-x,

Sim, esta ativado sim. Nas Environment, enviei removendo meus dados, porem, estão devidamente configurados.

Veja nos prints abaixo.

Configs Mongo Evo Mongo Evo

Configs Chatwoot Evo ChatWoot Evo

Se precisar de mais alguma info, me avise.

jaison-x commented 5 months ago

Você está usando a versão develop, ou então o PR que citei acima? Estas melhorias ainda não estão na última versão.

guibarbas commented 5 months ago

Estou usando a versão homolog atendai/evolution-api:homolog

Realizei a reinstalação da Evo, removendo tudo, incluindo Database.

Ao testar agora, o editar funcionou. (Ele envia como se fosse uma nova resposta) Seria interessante, se pudesse editar a mensagem na interface do Chatwoot, mas mesmo enviando como uma resposta, já é excelente.

Entretanto, em relação ao deletar e as figurinhas, seguem com erro.

Veja: ChatWoot Evo teste 18-03-2024

WhatsApp Evo teste 18-03-2024 0

ChatWoot Evo teste 18-03-2024 1

WhatsApp Evo teste 18-03-2024 3

Aqui o log de erro ao enviar as figurinhas: [Evolution API] v1.7.0 1 - Mon Mar 18 2024 11:31:43 ERROR [WAStartupService] [object]
AxiosError: getaddrinfo ENOTFOUND web.whatsapp.net at AxiosError.from (file:///evolution/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///evolution/node_modules/axios/lib/adapters/http.js:610:25) at RedirectableRequest.emit (node:events:514:28) at RedirectableRequest.emit (node:domain:488:12) at eventHandlers. (/evolution/node_modules/follow-redirects/index.js:38:24) at ClientRequest.emit (node:events:514:28) at ClientRequest.emit (node:domain:488:12) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at TLSSocket.emit (node:domain:488:12) at Axios.request (file:///evolution/node_modules/axios/lib/core/Axios.js:45:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async getHttpStream (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:317:21) at async downloadEncryptedContent (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:450:21) at async downloadMsg (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:743:24) at async downloadMediaMessage (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:703:24) { hostname: 'web.whatsapp.net', syscall: 'getaddrinfo', code: 'ENOTFOUND', errno: -3008, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: Infinity, maxBodyLength: Infinity, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': undefined, Origin: 'https://web.whatsapp.com', 'User-Agent': 'axios/1.6.8', 'Accept-Encoding': 'gzip, compress, deflate, br' }, responseType: 'stream', method: 'get', url: 'https://web.whatsapp.net', data: undefined }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError],
  socket: [Function: handleRequestSocket]
},
_eventsCount: 3,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: Infinity,
  protocol: 'https:',
  path: '/',
  method: 'GET',
  headers: [Object: null prototype],
  agents: [Object],
  auth: undefined,
  family: undefined,
  beforeRedirect: [Function: dispatchBeforeRedirect],
  beforeRedirects: [Object],
  hostname: 'web.whatsapp.net',
  port: '',
  agent: undefined,
  nativeProtocols: [Object],
  pathname: '/'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: true,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [TLSSocket],
  _header: 'GET / HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'Origin: https://web.whatsapp.com\r\n' +
    'User-Agent: axios/1.6.8\r\n' +
    'Accept-Encoding: gzip, compress, deflate, br\r\n' +
    'Host: web.whatsapp.net\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: [Function: emitRequestTimeout],
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'web.whatsapp.net',
  protocol: 'https:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'https://web.whatsapp.net/',
[Symbol(kCapture)]: false

}, cause: Error: getaddrinfo ENOTFOUND web.whatsapp.net at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'web.whatsapp.net' } } [Evolution API] v1.7.0 1 - Mon Mar 18 2024 11:31:43 ERROR [ChatwootService] [object]
{ status: 400, error: 'Bad Request', message: [ 'Error: getaddrinfo ENOTFOUND web.whatsapp.net' ] }

jaison-x commented 5 months ago

Estou usando a versão homolog atendai/evolution-api:homolog

Realizei a reinstalação da Evo, removendo tudo, incluindo Database.

Ao testar agora, o editar funcionou. (Ele envia como se fosse uma nova resposta) Seria interessante, se pudesse editar a mensagem na interface do Chatwoot, mas mesmo enviando como uma resposta, já é excelente.

Entretanto, em relação ao deletar e as figurinhas, seguem com erro.

Veja: ChatWoot Evo teste 18-03-2024

WhatsApp Evo teste 18-03-2024 0

ChatWoot Evo teste 18-03-2024 1

WhatsApp Evo teste 18-03-2024 3

Aqui o log de erro ao enviar as figurinhas: [Evolution API] v1.7.0 1 - Mon Mar 18 2024 11:31:43 ERROR [WAStartupService] [object] AxiosError: getaddrinfo ENOTFOUND web.whatsapp.net at AxiosError.from (file:///evolution/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (file:///evolution/node_modules/axios/lib/adapters/http.js:610:25) at RedirectableRequest.emit (node:events:514:28) at RedirectableRequest.emit (node:domain:488:12) at eventHandlers. (/evolution/node_modules/follow-redirects/index.js:38:24) at ClientRequest.emit (node:events:514:28) at ClientRequest.emit (node:domain:488:12) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at TLSSocket.emit (node:domain:488:12) at Axios.request (file:///evolution/node_modules/axios/lib/core/Axios.js:45:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async getHttpStream (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:317:21) at async downloadEncryptedContent (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js:450:21) at async downloadMsg (/evolution/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js:743:24) at async downloadMediaMessage (/evolution/nodemodules/@whiskeysockets/baileys/lib/Utils/messages.js:703:24) { hostname: 'web.whatsapp.net', syscall: 'getaddrinfo', code: 'ENOTFOUND', errno: -3008, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: Infinity, maxBodyLength: Infinity, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /_', 'Content-Type': undefined, Origin: 'https://web.whatsapp.com', 'User-Agent': 'axios/1.6.8', 'Accept-Encoding': 'gzip, compress, deflate, br' }, responseType: 'stream', method: 'get', url: 'https://web.whatsapp.net', data: undefined }, request: <ref 1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: Infinity, protocol: 'https:', path: '/', method: 'GET', headers: [Object: null prototype], agents: [Object], auth: undefined, family: undefined, beforeRedirect: [Function: dispatchBeforeRedirect], beforeRedirects: [Object], hostname: 'web.whatsapp.net', port: '', agent: undefined, nativeProtocols: [Object], pathname: '/' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [TLSSocket], header: 'GET / HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /_\r\n' + 'Origin: https://web.whatsapp.com\r\n' + 'User-Agent: axios/1.6.8\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: web.whatsapp.net\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/', _ended: false, res: null, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'web.whatsapp.net', protocol: 'https:', _redirectable: [Circular 1], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null }, _currentUrl: 'https://web.whatsapp.net/', [Symbol(kCapture)]: false }, cause: Error: getaddrinfo ENOTFOUND web.whatsapp.net at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'web.whatsapp.net' } } [Evolution API] v1.7.0 1 - Mon Mar 18 2024 11:31:43 ERROR [ChatwootService] [object] { status: 400, error: 'Bad Request', message: [ 'Error: getaddrinfo ENOTFOUND web.whatsapp.net' ] }

O chatwoot não permite edição de mensagens. A única forma é enviar uma nova mensagem com o conteúdo editado.

Sobre o deletar, verifique este parâmetro: image

Sobre a figurinha, se não estou enganado este é um problema diretamente da baileys. Se não me engano no whatsweb para figurinhas criadas nele, algo assim. Não tem relação com a evolution. Dê uma pesquisada no git da baileys que tem um issue sobre isso.

guibarbas commented 5 months ago

Opa @jaison-x, compreendo.

Sobre o deletar, não sei se estou entendendo errado, ou se é algum bug, mas havia deixado definido como: CHATWOOT_MESSAGE_DELETE=true

Entretanto, não estava deletando. Ao modificar para false, esta removendo normalmente do CW. O que compreendi é que ser deixar como "false" as mensagens não serão removidas do ChatWoot, e se deixar como true, sim, certo? Contudo, esta funcionando exatamente o contrario. image

Já sobre as figurinhas, compreendi, vou verificar sim. Neste caso, seria possivel adicionar algum tipo de mensagem de erro? Como é feito com o Typebot? Deste modo, poderíamos informar ao usuário que o arquivo que envio não é suportado.

BrOrlandi commented 4 months ago

Não testei a fundo a configuração de sincronizar as mensagens que foram apagadas. Assim como as mensagens editadas, tem como apenas sinalizar que a mensagem foi apagada mas continuar exibindo ela? É útil saber que foi apagada mas pode ser útil saber o conteúdo. Com essa configuração do CHATWOOT_MESSAGE_DELETE ele só apaga do chatwoot também, sem permitir a visualização anterior.