evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

Message timestamps shifted by -3h when using Chatwoot integration (v2.3.2)

Open fabriciofeijo opened this issue 1 year ago • 2 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

I enabled the integration between Evolution API and Chatwoot (both running in the same Docker Swarm stack with shared timezone configuration) by connecting Evolution API to the Chatwoot PostgreSQL database (with pgvector support). After doing this, I started noticing that all messages processed by Evolution API were written to Chatwoot with a 3-hour offset behind the actual time.

What did you expect?

I expected Evolution API to insert the messages into Chatwoot’s database without altering the original message timestamp, especially since all containers are configured with the same timezone (America/Sao_Paulo, UTC-3).

What did you observe instead of what you expected?

Evolution API is inserting messages into Chatwoot’s database with timestamps 3 hours earlier than the actual message time. This causes Chatwoot to display messages out of order and breaks the conversation history flow. The timestamp offset does not occur when Chatwoot receives messages natively through its own channels.

Screenshots/Videos

No response

Which version of the API are you using?

Evolution API version: 2.3.2

What is your environment?

Docker

Other environment specifications

I’m running a self-hosted setup on Docker Swarm managed by Portainer. The stack includes: • Evolution API v2.3.2 • Chatwoot v4.5.2 • PostgreSQL (with pgvector) pg16 • All services are part of the same Swarm network.

There are no timezone mismatches in the containers or the Docker host. This strongly suggests that the Evolution API is applying a -3h offset manually or via some unintended transformation when saving to the database.

If applicable, paste the log output

There are no errors in the logs, but the affected database entries contain a messageTimestamp that is consistently 3 hours earlier than it should be.

Additional Notes

This issue affects data consistency and breaks message threading logic in Chatwoot. It should be considered a critical bug for those using the Evolution API with database integration.

I’m happy to provide additional logs, examples of affected message records, or help test a patch.

fabriciofeijo avatar Sep 18 '25 10:09 fabriciofeijo

aqui tem a solução #1495

WanderleyGrecco avatar Sep 18 '25 12:09 WanderleyGrecco

Obrigado, resolveu meu problema!

fabriciofeijo avatar Sep 18 '25 14:09 fabriciofeijo