From 952f367581e58fe69c47d84af6f5c8cfb0107077 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 13 Sep 2022 15:40:02 +0200 Subject: [PATCH 01/14] first pass --- ...999-remote-location-notification-toggle.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 proposals/9999-remote-location-notification-toggle.md diff --git a/proposals/9999-remote-location-notification-toggle.md b/proposals/9999-remote-location-notification-toggle.md new file mode 100644 index 00000000000..c52981d0621 --- /dev/null +++ b/proposals/9999-remote-location-notification-toggle.md @@ -0,0 +1,54 @@ +# MSCXXX: Silence local notifications +Some clients (eg Element Web) do not use http pushers for notifications, but rather generate their own notifications in +the client based on the `/sync` response. + +To allow these clients to silence notifications remotely we will use account data and client-side notification +filtering. + +## Proposal +Add a new account data event `m.local_notification_settings.` with content: +```jsonp +{ + is_silenced: boolean +} +``` +During client-side notification generation: +- While no `local_notification_settings` event exists for the current device, or a `local_notification_settings` event + exists where `is_silenced` is falsy, events should be processed as normal and trigger system notifications and sounds + where necessary. +- While a `local_notification_settings` event exists for the current device where `is_silenced` is true, no event should + trigger a system notification or sound. + +#### Support +Clients that implement `m.local_notification_settings.` notification filtering should ensure a +`local_notification_settings` event exists for the active device to indicate support for that device. Clients should +only expose local notification silencing controls for devices that have indicated their support. + +When a device is removed these events should be pruned by clients. + +This proposal only refers to notifications that are generated on the client. Silencing of push notifications is covered +by [MSC3881: Remotely toggle push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881) + +## Alternatives +#### Push rules with profile tags +The spec allows for pushers to be assigned a +[`profile_tag`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) which can be used to +define per-device push rule sets. In combination with the `notify_in_app` action proposed in +[MSC3768](https://github.com/matrix-org/matrix-spec-proposals/pull/3768) this would allow to toggle a pusher between the +`global` push rule set and a push rule set where all rules with `notify` actions were overridden to use `notify_in_app`. +Furthermore, the overrides could be simplified through cascading profile tags as proposed in +[MSC3837](https://github.com/matrix-org/matrix-spec-proposals/pull/3837). Keeping the two sets in sync would, however, +not be trivial. Additionally, profile tags are only partially spec'ed and there is active interest in +[removing](https://github.com/matrix-org/matrix-spec/issues/637) them entirely. If feasible, this would allow for remote +control of notifications for clients using http-pushers and local notification generation. + +## Security considerations +N/A + +## Dependencies +Proper deletion of account data is enabled by [MSC3391: Removing account +data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) + +## Unstable prefix +While this MSC is not included in the spec `m.local_notification_settings.` should use the unstable prefix +`m.mscXXX.local_notification_settings.` From 1684fbaf82205058840818b076b4d884f2db51e3 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 13 Sep 2022 15:47:59 +0200 Subject: [PATCH 02/14] more wordiness --- .../9999-remote-location-notification-toggle.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/proposals/9999-remote-location-notification-toggle.md b/proposals/9999-remote-location-notification-toggle.md index c52981d0621..914a3c7dab3 100644 --- a/proposals/9999-remote-location-notification-toggle.md +++ b/proposals/9999-remote-location-notification-toggle.md @@ -1,10 +1,15 @@ -# MSCXXX: Silence local notifications +# MSCXXX: Remotely silence local notifications Some clients (eg Element Web) do not use http pushers for notifications, but rather generate their own notifications in -the client based on the `/sync` response. +the client based on the `/sync` response. Users should be able to remotely toggle on and off these notifications (as +well as [push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control interruptions +and reachability in private and professional contexts. To allow these clients to silence notifications remotely we will use account data and client-side notification filtering. +*This proposal only refers to notifications that are generated on the client. Silencing of push notifications is covered +by [MSC3881: Remotely toggle push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)* + ## Proposal Add a new account data event `m.local_notification_settings.` with content: ```jsonp @@ -26,9 +31,6 @@ only expose local notification silencing controls for devices that have indicate When a device is removed these events should be pruned by clients. -This proposal only refers to notifications that are generated on the client. Silencing of push notifications is covered -by [MSC3881: Remotely toggle push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881) - ## Alternatives #### Push rules with profile tags The spec allows for pushers to be assigned a From 7d92ffb7b95e57ab0a7a461fb84fc3b507e1ffea Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 13 Sep 2022 15:48:51 +0200 Subject: [PATCH 03/14] weird file name --- ...ication-toggle.md => 9999-remote-local-notification-toggle.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename proposals/{9999-remote-location-notification-toggle.md => 9999-remote-local-notification-toggle.md} (100%) diff --git a/proposals/9999-remote-location-notification-toggle.md b/proposals/9999-remote-local-notification-toggle.md similarity index 100% rename from proposals/9999-remote-location-notification-toggle.md rename to proposals/9999-remote-local-notification-toggle.md From 60695654956019c51f88f0f88ca02280ef00bc13 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 13 Sep 2022 15:49:44 +0200 Subject: [PATCH 04/14] msc number --- ...ion-toggle.md => 3890-remote-local-notification-toggle.md} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename proposals/{9999-remote-local-notification-toggle.md => 3890-remote-local-notification-toggle.md} (96%) diff --git a/proposals/9999-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md similarity index 96% rename from proposals/9999-remote-local-notification-toggle.md rename to proposals/3890-remote-local-notification-toggle.md index 914a3c7dab3..3b4a9969495 100644 --- a/proposals/9999-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -1,4 +1,4 @@ -# MSCXXX: Remotely silence local notifications +# MSC3890: Remotely silence local notifications Some clients (eg Element Web) do not use http pushers for notifications, but rather generate their own notifications in the client based on the `/sync` response. Users should be able to remotely toggle on and off these notifications (as well as [push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control interruptions @@ -53,4 +53,4 @@ data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) ## Unstable prefix While this MSC is not included in the spec `m.local_notification_settings.` should use the unstable prefix -`m.mscXXX.local_notification_settings.` +`m.msc3890.local_notification_settings.` From dc590b649ef7194b795c33581fc6a23857192538 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 13 Sep 2022 16:18:02 +0200 Subject: [PATCH 05/14] define target notifications --- proposals/3890-remote-local-notification-toggle.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index 3b4a9969495..f7ccc3a15e8 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -7,6 +7,13 @@ and reachability in private and professional contexts. To allow these clients to silence notifications remotely we will use account data and client-side notification filtering. +This proposal seeks to silence interrupting notifications that are generated in the client. This includes: +- system notifications such as system banners, popups, system notification center +- sounds, including noisy notifications and ringers + +In-app notifications will not be affected, with in-app notification center, badges, unread markers and counts remaining +the same. + *This proposal only refers to notifications that are generated on the client. Silencing of push notifications is covered by [MSC3881: Remotely toggle push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)* From f45627893e87fd30353d330f7b8e810af7b0e192 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Wed, 14 Sep 2022 08:39:45 +0200 Subject: [PATCH 06/14] correct prefix --- proposals/3890-remote-local-notification-toggle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index f7ccc3a15e8..a1f3667355c 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -60,4 +60,4 @@ data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) ## Unstable prefix While this MSC is not included in the spec `m.local_notification_settings.` should use the unstable prefix -`m.msc3890.local_notification_settings.` +`org.matrix.msc3890.local_notification_settings.` From 03bfdb4aebc7cfc2b06b8e09817c29905e247e3e Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Thu, 29 Sep 2022 11:35:46 +0200 Subject: [PATCH 07/14] server side removal of events --- proposals/3890-remote-local-notification-toggle.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index a1f3667355c..4a30ce619cb 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -31,13 +31,17 @@ During client-side notification generation: - While a `local_notification_settings` event exists for the current device where `is_silenced` is true, no event should trigger a system notification or sound. +During server-side removal of devices: +- When devices are removed servers should delete any +`m.local_notification_settings.` account_data events for the given device, and communicate these changes to +clients as described in [MSC3391](https://github.com/matrix-org/matrix-spec-proposals/pull/3391). + + #### Support Clients that implement `m.local_notification_settings.` notification filtering should ensure a `local_notification_settings` event exists for the active device to indicate support for that device. Clients should only expose local notification silencing controls for devices that have indicated their support. -When a device is removed these events should be pruned by clients. - ## Alternatives #### Push rules with profile tags The spec allows for pushers to be assigned a @@ -55,7 +59,7 @@ control of notifications for clients using http-pushers and local notification g N/A ## Dependencies -Proper deletion of account data is enabled by [MSC3391: Removing account +Communication of deletion of account data to clients is enabled by [MSC3391: Removing account data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) ## Unstable prefix From 435aa529e68ef5492008b7ccb71aabc0750464b3 Mon Sep 17 00:00:00 2001 From: Kerry Date: Mon, 21 Nov 2022 11:20:59 +1300 Subject: [PATCH 08/14] Add msc number to link Co-authored-by: Travis Ralston --- proposals/3890-remote-local-notification-toggle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index 4a30ce619cb..ff74da5089e 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -1,7 +1,7 @@ # MSC3890: Remotely silence local notifications Some clients (eg Element Web) do not use http pushers for notifications, but rather generate their own notifications in the client based on the `/sync` response. Users should be able to remotely toggle on and off these notifications (as -well as [push notifications](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control interruptions +well as [push notifications (MSC3881)](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control interruptions and reachability in private and professional contexts. To allow these clients to silence notifications remotely we will use account data and client-side notification From f09deabf891a3367cdc1e602f7baececa7664ae4 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 21 Nov 2022 11:26:09 +1300 Subject: [PATCH 09/14] remove explicit 3391 dependency --- .../3890-remote-local-notification-toggle.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index ff74da5089e..8d739ee3145 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -1,8 +1,8 @@ # MSC3890: Remotely silence local notifications Some clients (eg Element Web) do not use http pushers for notifications, but rather generate their own notifications in the client based on the `/sync` response. Users should be able to remotely toggle on and off these notifications (as -well as [push notifications (MSC3881)](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control interruptions -and reachability in private and professional contexts. +well as [push notifications (MSC3881)](https://github.com/matrix-org/matrix-spec-proposals/pull/3881)) to control +interruptions and reachability in private and professional contexts. To allow these clients to silence notifications remotely we will use account data and client-side notification filtering. @@ -32,10 +32,12 @@ During client-side notification generation: trigger a system notification or sound. During server-side removal of devices: -- When devices are removed servers should delete any -`m.local_notification_settings.` account_data events for the given device, and communicate these changes to -clients as described in [MSC3391](https://github.com/matrix-org/matrix-spec-proposals/pull/3391). +- When devices are removed servers should delete any `m.local_notification_settings.` account_data events for +the given device, and communicate these changes to clients as described in +[MSC3391](https://github.com/matrix-org/matrix-spec-proposals/pull/3391). +A server is to clean up deleted device account data when able to do so, such as with [MSC3391: Removing account +data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) #### Support Clients that implement `m.local_notification_settings.` notification filtering should ensure a @@ -58,10 +60,6 @@ control of notifications for clients using http-pushers and local notification g ## Security considerations N/A -## Dependencies -Communication of deletion of account data to clients is enabled by [MSC3391: Removing account -data.](https://github.com/matrix-org/matrix-spec-proposals/pull/3391) - ## Unstable prefix While this MSC is not included in the spec `m.local_notification_settings.` should use the unstable prefix `org.matrix.msc3890.local_notification_settings.` From 10be7fbc1ac4d96313e243e960c3bb0d5296194d Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 30 Jan 2023 20:14:41 +1300 Subject: [PATCH 10/14] add note about interaction with msc3381 --- .../3890-remote-local-notification-toggle.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index 8d739ee3145..b9190d217f9 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -24,14 +24,37 @@ Add a new account data event `m.local_notification_settings.` with co is_silenced: boolean } ``` -During client-side notification generation: + +#####During client-side notification generation: + +- While a registered pusher exists for the current device any `local_notification_settings` event should be ignored and + events should trigger system notifications as normal. For servers that support + [MSC3381](https://github.com/matrix-org/matrix-doc/pull/3881), the `local_notification_settings` is ignored and local + notifications are triggered based on the `enabled` setting of the registered pusher. - While no `local_notification_settings` event exists for the current device, or a `local_notification_settings` event exists where `is_silenced` is falsy, events should be processed as normal and trigger system notifications and sounds where necessary. - While a `local_notification_settings` event exists for the current device where `is_silenced` is true, no event should trigger a system notification or sound. -During server-side removal of devices: +#####Displaying notification settings: + +Clients should endeavour to display notification settings that reflect the rules above. + +- While a registered pusher exists for a device, notifications should be displayed as enabled. While the client has the + ability to register/remove pushers for the device, toggling this setting should register or remove the pusher. For + servers that support [MSC3381](https://github.com/matrix-org/matrix-doc/pull/3881), notifications should be displayed + as enabled according to the the `enabled` setting of the pusher. Changing this setting should update the `enabled` + field of the pusher. +- While the client does not have the ability to register a pusher and a `local_notification_settings` event exists, + notifications should be displayed as `enabled` when the event's `is_silenced` field is falsy. Updating the setting + should change the event's `is_silenced` field. +- While the client does not have the ability to register a pusher and no `local_notification_settings` event exists, + notifications should be displayed as disabled. The setting should not be editable. + + +#####During server-side removal of devices: + - When devices are removed servers should delete any `m.local_notification_settings.` account_data events for the given device, and communicate these changes to clients as described in [MSC3391](https://github.com/matrix-org/matrix-spec-proposals/pull/3391). From 9bbcf3d69dbcca1d6930107d187036724d61ccc1 Mon Sep 17 00:00:00 2001 From: Kerry Date: Tue, 31 Jan 2023 10:23:09 +1300 Subject: [PATCH 11/14] Update proposals/3890-remote-local-notification-toggle.md Co-authored-by: Johannes Marbach --- proposals/3890-remote-local-notification-toggle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index b9190d217f9..3ec2187593e 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -44,7 +44,7 @@ Clients should endeavour to display notification settings that reflect the rules - While a registered pusher exists for a device, notifications should be displayed as enabled. While the client has the ability to register/remove pushers for the device, toggling this setting should register or remove the pusher. For servers that support [MSC3381](https://github.com/matrix-org/matrix-doc/pull/3881), notifications should be displayed - as enabled according to the the `enabled` setting of the pusher. Changing this setting should update the `enabled` + as enabled according to the `enabled` setting of the pusher. Changing this setting should update the `enabled` field of the pusher. - While the client does not have the ability to register a pusher and a `local_notification_settings` event exists, notifications should be displayed as `enabled` when the event's `is_silenced` field is falsy. Updating the setting From 28d723d93172296e1b46df4f6283e02b216da229 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Fri, 10 Feb 2023 17:13:08 +1300 Subject: [PATCH 12/14] heading fix --- proposals/3890-remote-local-notification-toggle.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index 3ec2187593e..021a0e58bf5 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -25,7 +25,7 @@ Add a new account data event `m.local_notification_settings.` with co } ``` -#####During client-side notification generation: +##### During client-side notification generation: - While a registered pusher exists for the current device any `local_notification_settings` event should be ignored and events should trigger system notifications as normal. For servers that support @@ -37,7 +37,7 @@ Add a new account data event `m.local_notification_settings.` with co - While a `local_notification_settings` event exists for the current device where `is_silenced` is true, no event should trigger a system notification or sound. -#####Displaying notification settings: +##### Displaying notification settings: Clients should endeavour to display notification settings that reflect the rules above. @@ -53,7 +53,7 @@ Clients should endeavour to display notification settings that reflect the rules notifications should be displayed as disabled. The setting should not be editable. -#####During server-side removal of devices: +##### During server-side removal of devices: - When devices are removed servers should delete any `m.local_notification_settings.` account_data events for the given device, and communicate these changes to clients as described in From 2e25a3a9cdf2364d2a3ea6e12a1fabe51c6f825b Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Fri, 10 Feb 2023 17:22:09 +1300 Subject: [PATCH 13/14] alternatives note about per-device account data --- proposals/3890-remote-local-notification-toggle.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index 021a0e58bf5..c2cbed9dd75 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -52,7 +52,6 @@ Clients should endeavour to display notification settings that reflect the rules - While the client does not have the ability to register a pusher and no `local_notification_settings` event exists, notifications should be displayed as disabled. The setting should not be editable. - ##### During server-side removal of devices: - When devices are removed servers should delete any `m.local_notification_settings.` account_data events for @@ -68,6 +67,14 @@ Clients that implement `m.local_notification_settings.` notification only expose local notification silencing controls for devices that have indicated their support. ## Alternatives + +#### Per device account data +To enable easier retrieval and management of device-scoped account data events a new per-device account data could be +introduced. This would behave similarly to per-room account data. Per-device account data events would be removed by the +server during device removal. +With per-device account data, the event type could be +simplified to `m.local_notification_settings` + #### Push rules with profile tags The spec allows for pushers to be assigned a [`profile_tag`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) which can be used to From 3eb406229177b79847cab1fec2479fe336ffc353 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 20 Feb 2023 15:58:51 +1300 Subject: [PATCH 14/14] add notes about profile tags suitability --- proposals/3890-remote-local-notification-toggle.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proposals/3890-remote-local-notification-toggle.md b/proposals/3890-remote-local-notification-toggle.md index c2cbed9dd75..e4e620fb603 100644 --- a/proposals/3890-remote-local-notification-toggle.md +++ b/proposals/3890-remote-local-notification-toggle.md @@ -75,7 +75,7 @@ server during device removal. With per-device account data, the event type could be simplified to `m.local_notification_settings` -#### Push rules with profile tags +#### Push rules with profile tags (aka per device push rules) The spec allows for pushers to be assigned a [`profile_tag`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) which can be used to define per-device push rule sets. In combination with the `notify_in_app` action proposed in @@ -87,6 +87,11 @@ not be trivial. Additionally, profile tags are only partially spec'ed and there [removing](https://github.com/matrix-org/matrix-spec/issues/637) them entirely. If feasible, this would allow for remote control of notifications for clients using http-pushers and local notification generation. +Effective per device notification silencing using profile tags relies on a few complex pieces of work (push rules with +profile tags, `notify_in_app` push rule action, potentially cascading profile tags). While a more elegant solution, it +is unlikely to land in the short or medium term. This MSC proposes a short term fix for a common user issue. As +better solutions become available clients may choose to stop supporting `local_notification_settings`. + ## Security considerations N/A