matrix-org / matrix-org/matrix-hookshot
Passing `mentions.room` in JSON payload (v2 API) does not pass it to the Matrix message
- Dominant language
- TypeScript
- Stars
- 450
- Forks
- 95
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 23
Description
```json
"mentions": {
"room": true
}
```
Does not lead to the generated Matrix message including the room as a mentioned participant.
Below is the payload I use for my Webhook (as configured in Grafana, copied and pasted directly here):
```json
{"version":"v2","msgtype":"m.notice","mentions":{"room":true},"text":"@room\n\n# {{if eq .Status "firing"}}🚨 ALERT FIRING{{else}}✅ ALERT RESOLVED{{end}}\n\n---------\n\n###### Details \n\n- **Name:** {{.CommonLabels.alertname}}{{if .CommonLabels.severity}}\n- **Severity:** {{.CommonLabels.severity}}{{end}}{{if .CommonAnnotations.summary}}\n- **Summary:** {{.CommonAnnotations.summary}}{{end}}\n\n-------------\n\n###### Alerts \n\n{{range .Alerts}}- {{if eq .Status "firing"}}🚨{{else}}✅{{end}} {{if .Labels.legend}}{{.Labels.legend}}{{else}}N/A ('legend' label missing){{end}}\n\t- **Start Time:** {{.StartsAt.String}}\n{{if .ValueString}}\t- **Values:** {{.ValueString}}\n{{end}}{{if .DashboardURL}}\t- [Alert Dashboard]({{.DashboardURL}})\n{{end}}{{if .PanelURL}}\t- [Alert Panel]({{.PanelURL}})\n{{end}}{{if .SilenceURL}}\t- [Silence this Alert]({{.SilenceURL}})\n{{end}}\n{{end}}\n**[Open Grafana Dashboard]({{.ExternalURL}})**\n"}
```
The following is a screenshot of the Matrix message generated:
Inspecting the message via Element on Desktop shows that there is no `m.mentions` JSON object sent by Hookshot.
Contributor guide
Research direction
Trace the v2 webhook payload handling from the mentions.room field through generation of the Matrix message. Compare the resulting event with the expected m.mentions JSON object; done when a payload with mentions.room set to true produces the room mention in the generated message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100