Skip to content

Notification text now uses formatted_body instead of body, breaking integrations that set a concise body (regression?) #33357

Description

@bl4ckswordsman

Steps to reproduce

  1. Send a payload via maubot/matrix-hookshot etc that contains both content.body and content.formatted_body.

Outcome

What did you expect?

Previous behavior: notification shows content.body -> short, clean message text

What happened instead?

Current behavior: notification shows formatted_body.textContent -> full content including quoted/embedded blocks, making notifications convoluted and hard to read


The PR #31699 introducing getNotificationBodyWithoutSpoilers changed notification text to be derived from formatted_body (via textContent) when present, rather than content.body.

This is a regression for bots, webhooks, and integrations (e.g. Hookshot) that intentionally set a short, human-readable body alongside a richer formatted_body containing additional content such as blockquotes. The body field was previously used for notification text, keeping it concise and readable. Authors of these integrations reasonably relied on this behavior.

Suggested fix: Either:

  • Strip <blockquote> elements from notification text alongside spoilers (since they represent quoted/external content rather than the sender's own words), or
  • Prefer content.body as the notification text baseline, and handle spoilers separately rather than switching the source field entirely

Related:
Issue #17859 is seemingly the same class of problem.

Operating system

Linux

Browser information

Firefox 150.0.1

URL for webapp

v1.12.17

Application version

1.12.17

Homeserver

Synapse 1.152.0

Will you send logs?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NotificationsS-MajorSeverely degrades major functionality or product features, with no satisfactory workaroundT-Defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions