matrix-org / matrix-org/matrix-hookshot

content.html stripped for large events

Open
#1,112 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
450
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
23

Description

Hi, I've been debugging an issue today where our alerts (generic webhook) simply contained our "plain" fallback which is intended for clients that do not render HTML. If we replace the "plain" content with more about our alerts, we will just lose the html rendering sooner.

Turns out, it is because the html is stripped when the event size limit is exceeded.

Some short-term solutions:

  • Warning in the log (not great for end users).
  • Replace "html" with an error message if we have the event size budget. Otherwise, log the error.
  • Replace "html" and "plain" with an error message.

Only long term solution I can think of is if the transformation scripts API supported multiple events per call.

If you let me know you are happy with any of the short-term solutions, I'll submit the PR.

Thanks for hookshot 👍

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Connections/GenericHook.ts around line 699 and review the Matrix event size limits linked in the issue. First confirm which short-term behavior maintainers want, since the issue lists several alternatives without a decision. Done should mean oversized events no longer silently lose their HTML content, with the selected fallback or logging behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.