notifications silent in element x #1533

Closed
opened 2026-03-11 16:49:54 +00:00 by Reaster · 8 comments

hi, seems that in the case of element x, it need the tweaks field to be set, else would (?) default to silent notifications
the "tweaks"field in this example

"notification": {
"content": {
"body": "I'm floating in a most peculiar way.",
"msgtype": "m.text"
},
"counts": {
"missed_calls": 1,
"unread": 2
},
"devices": [
{
"app_id": "org.matrix.matrixConsole.ios",
"data": {},
"pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/",
"pushkey_ts": 12345678,
"tweaks": {
"sound": "bing"
}
}
],
"event_id": "$3957tyerfgewrf384",
"prio": "high",
"room_alias": "#exampleroom:matrix.org",
"room_id": "!slw48wfj34rtnrf:example.com",
"room_name": "Mission Control",
"sender": "@exampleuser:matrix.org",
"sender_display_name": "Major Tom",
"type": "m.room.message"
}
}

https://spec.matrix.org/v1.17/push-gateway-api/#post_matrixpushv1notify_request_device
"A dictionary of customisations made to the way this notification is to be presented. These are added by push rules."
at first i tought it was this at cause


				let mut device =
					Device::new(pusher.ids.app_id.clone(), pusher.ids.pushkey.clone());
				device.data.data.clone_from(&http.data);
				device.data.format.clone_from(&http.format);

				// Tweaks are only added if the format is NOT event_id_only
				if !event_id_only {
					device.tweaks.clone_from(&tweaks);
				}

mod.rs line 427
but apparently (jade) event_id_only that deactivate tweaks register is a good behaviour,

in that case maybe tweaks should have some kind of default values?

hi, seems that in the case of element x, it need the tweaks field to be set, else would (?) default to silent notifications the "tweaks"field in this example ```{ "notification": { "content": { "body": "I'm floating in a most peculiar way.", "msgtype": "m.text" }, "counts": { "missed_calls": 1, "unread": 2 }, "devices": [ { "app_id": "org.matrix.matrixConsole.ios", "data": {}, "pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/", "pushkey_ts": 12345678, "tweaks": { "sound": "bing" } } ], "event_id": "$3957tyerfgewrf384", "prio": "high", "room_alias": "#exampleroom:matrix.org", "room_id": "!slw48wfj34rtnrf:example.com", "room_name": "Mission Control", "sender": "@exampleuser:matrix.org", "sender_display_name": "Major Tom", "type": "m.room.message" } } ``` https://spec.matrix.org/v1.17/push-gateway-api/#post_matrixpushv1notify_request_device "A dictionary of customisations made to the way this notification is to be presented. These are added by push rules." at first i tought it was this at cause ``` let event_id_only = http.format == Some(PushFormat::EventIdOnly); let mut device = Device::new(pusher.ids.app_id.clone(), pusher.ids.pushkey.clone()); device.data.data.clone_from(&http.data); device.data.format.clone_from(&http.format); // Tweaks are only added if the format is NOT event_id_only if !event_id_only { device.tweaks.clone_from(&tweaks); } ``` mod.rs line 427 but apparently (jade) event_id_only that deactivate tweaks register is a good behaviour, in that case maybe tweaks should have some kind of default values?
Reaster changed title from default notifications silent in case event_id_only is set? to default notifications silent in element x 2026-03-11 16:50:17 +00:00
Reaster changed title from default notifications silent in element x to notifications silent in element x 2026-03-11 17:13:14 +00:00
Author

from what i understand, the spec don't specify that we should drop tweaks (clients[].tweaks) when event_id_only is set,

Homeserver behaviour

This describes the format used by “HTTP” pushers to send notifications of events to Push Gateways. If the endpoint returns an HTTP error code, the homeserver SHOULD retry for a reasonable amount of time using exponential backoff.

When pushing notifications for events, the homeserver is expected to include all of the event-related fields in the /notify request. When the homeserver is performing a push where the format is "event_id_only", only the event_id, room_id, counts, and devices are required to be populated.

Note that most of the values and behaviour of this endpoint is described by the Client-Server API’s Push Module.

http://spec.matrix.org/v1.17/push-gateway-api/#post_matrixpushv1notify_request_device
but synapse seems to do it anyway
github.com/element-hq/synapse@ae239280cb/synapse/push/httppusher.py (L492)
maybe they get it right because tweaks would be set by default in their case?

from what i understand, the spec don't specify that we should drop tweaks (clients[].tweaks) when event_id_only is set, ``` Homeserver behaviour This describes the format used by “HTTP” pushers to send notifications of events to Push Gateways. If the endpoint returns an HTTP error code, the homeserver SHOULD retry for a reasonable amount of time using exponential backoff. When pushing notifications for events, the homeserver is expected to include all of the event-related fields in the /notify request. When the homeserver is performing a push where the format is "event_id_only", only the event_id, room_id, counts, and devices are required to be populated. Note that most of the values and behaviour of this endpoint is described by the Client-Server API’s Push Module. ``` http://spec.matrix.org/v1.17/push-gateway-api/#post_matrixpushv1notify_request_device but synapse seems to do it anyway https://github.com/element-hq/synapse/blob/ae239280cb742968808ca1a4b7d7a84f67ca8177/synapse/push/httppusher.py#L492 maybe they get it right because tweaks would be set by default in their case?
Owner

Note that event_id_only exists because push notifications may be sent through intermediaries, and we want to avoid leaking metadata - clients are expected to fetch the actual event to display notifications. This is unlikely to be the issue.

Note that `event_id_only` exists because push notifications may be sent through intermediaries, and we want to avoid leaking metadata - clients are expected to fetch the actual event to display notifications. This is unlikely to be the issue.
Author

i still don't understand why "tweaks" would be a privacy issue, the spec don't precise to remove it, only synapse does it, but maybe never using tweaks when event_id_only is set and always using a default value for it would be a valid fix (i guess)

i still don't understand why "tweaks" would be a privacy issue, the spec don't precise to remove it, only synapse does it, but maybe never using tweaks when event_id_only is set and always using a default value for it would be a valid fix (i guess)
Owner

Duplicate of !1424 - clients should set the push rules they want to receive. Not including the "sound" tweak is correct per the current specification.

Duplicate of !1424 - clients should set the push rules they want to receive. Not including the "sound" tweak is correct per the current specification.
nex closed this issue 2026-03-11 17:22:16 +00:00
Author
fyi https://github.com/element-hq/element-x-ios/issues/5132
Author
https://github.com/matrix-org/matrix-rust-sdk/pull/6277
Owner

For anyone finding this issue, the matrix spec defines that messages should notify, but not make a sound (i.e. quiet notifications): https://spec.matrix.org/v1.17/client-server-api/#default-override-rules:~:text=%7D%0A%20%20%20%20%5D%0A%7D-,.m.rule.message,-Matches%20all%20chat

The reason this does not happen on Synapse is because Synapse's default push rules differ from the specification. Continuwuity is doing this correctly.
You can make them noisy by using another client, like Element Web, to modify the notification settings to make them noisy.

For anyone finding this issue, the matrix spec defines that messages should *notify*, but not make a *sound* (i.e. quiet notifications): https://spec.matrix.org/v1.17/client-server-api/#default-override-rules:~:text=%7D%0A%20%20%20%20%5D%0A%7D-,.m.rule.message,-Matches%20all%20chat The reason this does not happen on Synapse is because Synapse's default push rules differ from the specification. Continuwuity is doing this correctly. You can make them noisy by using another client, like Element Web, to modify the notification settings to make them noisy.

Even those who create rules can make mistakes.

Even those who create rules can make mistakes.
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1533
No description provided.