Description
Every time a WhatsApp text message (messageType: conversation) is edited by the sender,
the corresponding row in the Message table has its message column overwritten with a
JSON null instead of the updated content. This appears to be 100% reproducible in our
installation: every row with a MessageUpdate status of EDITED (2 out of 2 observed)
ended up with message = JSON null.
Impact
The Manager UI crashes when opening any chat containing such a message, with:
TypeError: Cannot read properties of null (reading 'contactMessage')
React Router catches it as an unhandled error and the chat screen renders blank/black —
the chat becomes permanently inaccessible in the Manager until the row is fixed directly
in the database.
Environment
- Evolution API version: 2.3.7
- Database: PostgreSQL
- Connector: Baileys (WhatsApp Web)
- Deployment: Docker (Coolify)
Steps to reproduce
- Send a text message from a device (observed with Android as source).
- Edit that message from the same device.
- Query the
Message table: the row's message column is now the JSON scalar null
(not SQL NULL — "message"::text = 'null'), while MessageUpdate for that message
shows a status of EDITED.
- Open that chat in the Manager UI — it crashes with the TypeError above.
Suspected cause
The messages.update handler (Baileys service) appears to write the incoming update's
message field directly to the database without falling back to the previous/edited
message content when the update payload's message is empty, and the Manager's message
renderer does not null-check message before accessing message.contactMessage /
similar fields.
Workaround
We added a Postgres trigger that preserves the previous message value whenever an
UPDATE would set it to NULL/JSON null, which prevents the crash. Happy to share it,
but a proper fix in the update handler (and a null-check in the Manager renderer) would
be preferable.
Description
Every time a WhatsApp text message (
messageType: conversation) is edited by the sender,the corresponding row in the
Messagetable has itsmessagecolumn overwritten with aJSON
nullinstead of the updated content. This appears to be 100% reproducible in ourinstallation: every row with a
MessageUpdatestatus ofEDITED(2 out of 2 observed)ended up with
message= JSONnull.Impact
The Manager UI crashes when opening any chat containing such a message, with:
TypeError: Cannot read properties of null (reading 'contactMessage')React Router catches it as an unhandled error and the chat screen renders blank/black —
the chat becomes permanently inaccessible in the Manager until the row is fixed directly
in the database.
Environment
Steps to reproduce
Messagetable: the row'smessagecolumn is now the JSON scalarnull(not SQL NULL —
"message"::text = 'null'), whileMessageUpdatefor that messageshows a status of
EDITED.Suspected cause
The
messages.updatehandler (Baileys service) appears to write the incoming update'smessagefield directly to the database without falling back to the previous/editedmessage content when the update payload's message is empty, and the Manager's message
renderer does not null-check
messagebefore accessingmessage.contactMessage/similar fields.
Workaround
We added a Postgres trigger that preserves the previous
messagevalue whenever anUPDATE would set it to
NULL/JSONnull, which prevents the crash. Happy to share it,but a proper fix in the update handler (and a null-check in the Manager renderer) would
be preferable.