Editing a text message sets Message.message to JSON null, crashing Manager chat view
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- postgresql, typescript
Research direction
Start with the messages.update handler in the Baileys service and trace how the incoming message field is written to the Message table, then inspect the Manager message renderer for contactMessage access. Reproduce the edit flow and verify the Message and MessageUpdate rows in PostgreSQL. Done means edited text remains available and opening the chat no longer crashes when the update payload lacks message content.
Written by the indexing model from the issue text.
Description
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
Messagetable: the row'smessagecolumn is now the JSON scalarnull
(not SQL NULL —"message"::text = 'null'), whileMessageUpdatefor that message
shows a status ofEDITED. - 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.
- Dominant language
- TypeScript
- Stars
- 9.6k
- Forks
- 7.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from evolution-foundation/evolution-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
evolution-foundation/evolution-api#2700 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in evolution-foundation/evolution-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·