Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Editing a text message sets Message.message to JSON null, crashing Manager chat view

未关闭
#2,672 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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
  1. Send a text message from a device (observed with Android as source).
  2. Edit that message from the same device.
  3. 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.
  4. 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

evolution-foundation/evolution-api 的其他 Issue

查看 evolution-foundation/evolution-api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。