Editing a text message sets Message.message to JSON null, crashing Manager chat view
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- postgresql, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 9.6k
- 派生
- 7.3k
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
evolution-foundation/evolution-api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 1/5 1-3 小时 新手友好度 88/100
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 88/100
evolution-foundation/evolution-api#2700 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
查看 evolution-foundation/evolution-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
receptron/mulmoterminal#2264 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
components-web-app/docs#96 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
simonsobs/tileviewer#114 ·
-
难度 2/5 1-3 小时 新手友好度 75/100