-
Notifications
You must be signed in to change notification settings - Fork 423
MSC3958: Suppress notifications from message edits #3958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
acf68ea
Suppress message edits.
clokep 344c18f
Fix typo.
clokep 09bb6ac
Add @room.
clokep 2ab860a
Match MSC title to PR.
clokep 216a54c
Add a potential issue.
clokep 69bd78b
Clarify rule placement.
clokep 950ad36
Change link text.
clokep 59d9172
Fix typo.
clokep 02fd5c7
Add a note about mobile clients.
clokep c0f11a1
Update from anoa's feedback.
clokep 876e19f
Updates for Matrix 1.7
clokep f93d03d
Update more spec links.
clokep 5c603f0
Minor clarifications.
clokep 1128719
Add downside about "all messages"
clokep 33083c0
Clarify again that this *does* work with all messages.
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
140 changes: 140 additions & 0 deletions
140
proposals/3958-suppress-notifications-of-message-edits.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| # MSC3958: Suppress notifications from message edits | ||
|
|
||
| [Event replacement](https://spec.matrix.org/v1.5/client-server-api/#event-replacements) | ||
| (more commonly known as message edits) signals that a message is intended to | ||
| be replaced with new content. | ||
|
|
||
| This works well for fixing typos or other minor correction, but can cause | ||
| spurious notifications if the event mentions a user's display name / localpart or | ||
| if it includes `@room` (which is particularly bad in large rooms as every user | ||
| is re-notified). This contributes to notification fatigue as the additional | ||
| notifications contain no new information. | ||
|
|
||
| ## Proposal | ||
|
|
||
| A new default push rule is added to suppress notifications due to [edits](https://spec.matrix.org/v1.5/client-server-api/#event-replacements). | ||
|
|
||
| ```json | ||
| { | ||
| "rule_id": ".m.rule.suppress_edits", | ||
| "default": true, | ||
| "enabled": true, | ||
| "conditions": [ | ||
| { | ||
| "kind": "event_match", | ||
| "key": "content.m.relates_to.rel_type", | ||
| "pattern": "m.replace" | ||
| } | ||
| ], | ||
| "actions": [] | ||
| } | ||
| ``` | ||
|
|
||
| This rule should be placed before the [`.m.rule.suppress_notices` rule](https://spec.matrix.org/v1.5/client-server-api/#default-override-rules) | ||
| as the first non-master, non-user added override rule. | ||
|
|
||
| It would match events such as those given in [event replacements](https://spec.matrix.org/v1.5/client-server-api/#event-replacements) | ||
| portion of the spec: | ||
|
|
||
| ```json5 | ||
| { | ||
| "type": "m.room.message", | ||
| "content": { | ||
| "body": "* Hello! My name is bar", | ||
| "msgtype": "m.text", | ||
| "m.new_content": { | ||
| "body": "Hello! My name is bar", | ||
| "msgtype": "m.text" | ||
| }, | ||
| "m.relates_to": { | ||
| "rel_type": "m.replace", | ||
| "event_id": "$some_event_id" | ||
| } | ||
| }, | ||
| // ... other fields required by events | ||
| } | ||
| ``` | ||
|
|
||
| Some users may be depending on notifications of edits. If a user would like to | ||
| revert to the old behavior they can disable the `.m.rule.suppress_edits` push rule. | ||
|
|
||
| ## Potential issues | ||
|
|
||
| ### Editing mentions | ||
|
|
||
| With this MSC it would no longer possible to edit a message to change who is going | ||
| to be notified. For instance, if you write a message and then edit it to put another | ||
| user pill in it, in this case the user would not be notified. Socially it seems more | ||
| likely for the sender to send another message instead of editing: | ||
|
|
||
| > @alice:example.com see above ^ | ||
|
|
||
| ### Rule Ambiguity | ||
|
|
||
| The rule is ambiguous (see [MSC3873](https://github.com/matrix-org/matrix-spec-proposals/pull/3873)) | ||
| due to the `.` in `m.relates_to` and could also match other, unrelated, events: | ||
clokep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```json5 | ||
| { | ||
| "type": "m.room.message", | ||
| "content": { | ||
| "body": "* Hello! My name is bar", | ||
| "msgtype": "m.text", | ||
| "m.new_content": { | ||
| "body": "Hello! My name is bar", | ||
| "msgtype": "m.text" | ||
| }, | ||
| "m": { | ||
| "relates_to": { | ||
| "rel_type": "m.replace", | ||
| "event_id": "$some_event_id" | ||
| } | ||
| } | ||
| }, | ||
| // ... other fields required by events | ||
| } | ||
| ``` | ||
|
|
||
| (Note that `relates_to` being embedded inside of the `m`.) | ||
|
|
||
| ### Keeping notifications up-to-date | ||
|
|
||
| Another issues is that mobile clients would no longer receive push notifications for | ||
| message edits, which are currently used to update the text of on-screen notifications | ||
| to show the updated content. The proposed push rule would mean that mobile clients would | ||
| no longer receive this update, but showing slightly outdated text on a notification screen | ||
| is only a minor impact and it would be better to separate when (& why) we send pushes vs. | ||
| when we generate notifications. | ||
|
|
||
| ## Alternatives | ||
clokep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| An alternative solution would be to add a push rule with no actions and a condition to | ||
| check whether a notification should have been generated for the user in the original | ||
| message. | ||
|
|
||
| This should be placed as an override rule before the `.m.rule.contains_display_name` | ||
| and the `.m.rule.roomnotif` [push rules](https://spec.matrix.org/v1.5/client-server-api/#push-rules). | ||
|
|
||
| This would suppress duplicate notifications, while still allow for new notifications due | ||
| to new mentions or keywords changing. | ||
|
|
||
| ## Security considerations | ||
|
|
||
| None forseen. | ||
|
|
||
| ## Future extensions | ||
|
|
||
| If message edits by other senders were allowed than it would be useful to | ||
| know when your own message was edited, but this | ||
| [is not currently allowed](https://spec.matrix.org/v1.5/client-server-api/#validity-of-replacement-events). | ||
| A future MSC to define this behavior should take into account notifying | ||
| users in this situation. | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| The unstable prefix of `.com.beeper.suppress_edits` should be used in place of | ||
| `.m.rule.suppress_edits`. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| N/A | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.