Skip to content
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

Notifications at mentions in encrypted rooms #2411

Closed
anym001 opened this issue Jan 31, 2024 · 13 comments
Closed

Notifications at mentions in encrypted rooms #2411

anym001 opened this issue Jan 31, 2024 · 13 comments

Comments

@anym001
Copy link

anym001 commented Jan 31, 2024

Steps to reproduce

Settings -> Notifications -> Groupchats -> Mentions and key words
(Your home server does not support this option in encrypted rooms. You may not be notified in some rooms.)

Outcome

What did you expect?

It would be great if you could also be notified of mentions in encrypted rooms.

What happened instead?

No notifications for mentions in encrypted rooms.

Your phone model

iPhone 14 Pro

Operating system version

iOS 17.3

Application version

1.5.4 (88)

Homeserver

matrix.minenet.at

Will you send logs?

No

@Velin92
Copy link
Member

Velin92 commented Feb 2, 2024

A homeserver needs to implement the following MSC which is experimental:
matrix-org/matrix-spec-proposals#4028

Matrix.org is working on implementing it on their server in the future, but if you have a server of your own you might need to update it or use a development version to support this.

Closing the issue since this is not something we can do anything from the app side.

@Velin92 Velin92 closed this as completed Feb 2, 2024
@ich777
Copy link

ich777 commented Feb 2, 2024

but if you have a server of your own you might need to update it or use a development version to support this.

...in response to that what needs to be updated or better speaking which development version needs to be used, this answer is a bit vague to me and the linked PR is blocked for merging

@Velin92
Copy link
Member

Velin92 commented Feb 2, 2024

but if you have a server of your own you might need to update it or use a development version to support this.

...in response to that what needs to be updated or better speaking which development version needs to be used, this answer is a bit vague to me and the linked PR is blocked for merging

If your server is using Synapse, it should have already been implemented in it (but I am not sure if a stable release with the implementation is already available, or if you might need to use a development/unstable version), you can get more info directly on Synapse

@ich777
Copy link

ich777 commented Feb 2, 2024

@Velin92 sorry but I've now found conflicting information on how to enable experimental features, some say you have to create a file called synapse.config.experimental with the contents from below and some say that you just have to put the contents from below into your homeserver.yaml

experimental:
  msc4028_push_encrypted_events: true

As far as I can tell synapse v1.100.0 should have that built in but I seem to can't get it to work with either methods since /_matrix/clients/versions always returns: {"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}

@Velin92
Copy link
Member

Velin92 commented Feb 14, 2024

@Velin92 sorry but I've now found conflicting information on how to enable experimental features, some say you have to create a file called synapse.config.experimental with the contents from below and some say that you just have to put the contents from below into your homeserver.yaml

experimental:
  msc4028_push_encrypted_events: true

As far as I can tell synapse v1.100.0 should have that built in but I seem to can't get it to work with either methods since /_matrix/clients/versions always returns: {"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}

Sorry but I don't know how I can help you since this repo is dedicated to Element-X-iOS, could you try asking or opening an issue on the synapse repo?

@ich777
Copy link

ich777 commented Feb 14, 2024

Sorry but I don't know how I can help you

Thanks for the response.

No worries, I now implemented everything that MSC4028 is supported on my homeserver and it even reports that it's enabled but on Element X it shows it's not supported by the homeserver, so isn't this related to Element X for iOS?

The homeserver now responds properly with:
"org.matrix.msc4028":true

@Velin92
Copy link
Member

Velin92 commented Feb 14, 2024

Sorry but I don't know how I can help you

Thanks for the response.

No worries, I now implemented everything that MSC4028 is supported on my homeserver and it even reports that it's enabled but on Element X it shows it's not supported by the homeserver, so isn't this related to Element X for iOS?

The homeserver now responds properly with: "org.matrix.msc4028":true

Could you try to check if this is also enabled for the push rules on your account/accounts? Since El-X checks also if the push rule for the account data has the MSC 4028 enabled globally.

@ich777
Copy link

ich777 commented Feb 14, 2024

I assume you are after that:

...
      {
        "conditions": [
          {
            "kind": "event_match",
            "key": "type",
            "pattern": "m.room.encrypted"
          }
        ],
        "actions": [
          "notify"
        ],
        "rule_id": ".org.matrix.msc4028.encrypted_event",
        "default": true,
        "enabled": false
      },
...

Good to know that this is the issue, I've now changed it and it seems to be resolved, at least the app doesn't list the message anymore!
I hope that was the correct way to change it:
curl -X PUT -H "Authorization: Bearer <YOURTOKEN>" -d '{"enabled":true}' http://<YOURHOMESERVER>:8008/_matrix/client/r0/pushrules/global/override/.org.matrix.msc4028.encrypted_event/enabled

@ich777
Copy link

ich777 commented Feb 14, 2024

@Velin92 sorry again a question, do all users have to change that setting on their own? This would be a huge bummer since with the command from above I changed it only for me correct?

@Velin92
Copy link
Member

Velin92 commented Feb 14, 2024

@Velin92 sorry again a question, do all users have to change that setting on their own? This would be a huge bummer since with the command from above I changed it only for me correct?

From what I understand the MSC should be enabled by default in the push rules even in its unstable prefix, as stated in MSC 4028 description when enabled in the server configurations

During development the new push rule shall use org.matrix.msc4028.encrypted_event instead of .m.rule.encrypted_event.

Caution: this unstable push rule will be enabled by default like the stable push rule, the server owners should wait for the clients to support a minimum this MSC before enabling the MSC server side.

So it's weird that you had to enable it manually for yourself.

@Velin92
Copy link
Member

Velin92 commented Feb 14, 2024

@ich777 Okay I double checked, as of right Synapse implements the configuration as an experimental/unstable setting. But it does not support yet that when enabled, it automatically adds itself as default global push rule for all the users, there is in fact an issue open about it:
element-hq/synapse#16846

So yeah as of right now users need to change this manually to support it.
But in the future it will be automatically added to the push rules of the users by default if the server has it enabled.

@ich777
Copy link

ich777 commented Feb 14, 2024

So yeah as of right now users need to change this manually to support it.

Thanks for confirming.

@alecdwm
Copy link

alecdwm commented Aug 23, 2024

For anyone who finds themselves looking for a way to enable experimental msc4028 support on their homeserver:

  1. Add this section to your homeserver.yaml and restart synapse
experimental_features:
  msc4028_push_encrypted_events: true
  1. Check if Update MSC4028 implementation: Enable the unstable push rule by default synapse#16846 has been merged.
    If not, obtain your access token from Element Desktop -> Settings -> Help & About -> Advanced and run this curl command:
curl -H 'Authorization: Bearer <access-token>' \
  https://<homeserver-url>/_matrix/client/r0/pushrules/global/override/.org.matrix.msc4028.encrypted_event/enabled \
  -XPUT \
  -d'{"enabled":true}'

You can check that it worked by removing -XPUT -d'{"enabled":true}' and running the command again, which will return {"enabled":true}.

You can also confirm that the following command includes "org.matrix.msc4028":true in the response:

curl -H "Authorization: Bearer <access-token>" https://<homeserver-url>/_matrix/client/versions                                                                                           

At this point, Element X should stop showing the does not support this option in encrypted rooms warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants