element-hq / element-meta

Shared/meta documentation and project artefacts for Element clients
75 stars 12 forks source link

[Story] Push-notifications for mentions #1095

Open kittykat opened 1 year ago

kittykat commented 1 year ago

As a user that is a member in a room I want to get a push notification every time another user is mentioning me ("@username" or "@room").

When I am already receiving push notifications for each new message in that room I do NOT want to get two push notifications. I only want to get one push notification that I was mentioned in a new message in a room as this message is personally directed at me it has a higher urgency / value to me.

I want to know who mentioned me in which room and what the content of the message is.

Scope

These should be a list of technical tasks which take ½-1 day to complete

### Android
- [ ] Task 1
### iOS
- [ ] Task 1
### Rust
- [ ] Task 1

Stretch goals

None at this time

## Out of scope - TBD
manuroe commented 1 year ago

@kittykat, is there something specific to do on the rendering of this type of notifications? We cannot see why we should treat it differently?

The " I do NOT want to get two push notifications" looks like more an (Android) bug.

clokep commented 1 year ago

When implementing mentions for Element X, it might make sense to only implement MSC3952, which deprecates a few of the current push rules and replaces them with a more explicit version to fix a handful of bugs.

Unfortunately this isn't really implemented anywhere else yet, although there are open PRs for Element Web.

daniellekirkwood commented 1 year ago

Plus 1 to @clokep 's comment. It does not make sense for y'all to build out the legacy system at this stage.

Also, @kittykat do we have a Keywords version of this issue or should we extend this one to be Keywords and Mentions?

manuroe commented 1 year ago

Be aware we already have the legacy system in place in the Rust SDK thanks to Ruma. This rust library is used by many rust matrix projects including Conduit, a rust matrix server. We get a lot of things from it. We need to check push rules one by one but it is very likely that we already have all existing push rules.

clokep commented 1 year ago

Be aware we already have the legacy system in place in the Rust SDK thanks to Ruma. This rust library is used by many rust matrix projects including Conduit, a rust matrix server. We get a lot of things from it. We need to check push rules one by one but it is very likely that we already have all existing push rules.

I was not aware the rust-sdk already implemented the push rule processing! 👍

ShadowJonathan commented 1 year ago

Ruma's inclusion of the legacy push rules isn't abnormal or notable; we just rust-i-fy the matrix spec as-is, without cherry-picking, having only having minimally-opinionated approaches.

Including MSC3952 into ruma would be a similar process, so there should possibly be SDK-level functionality or abstraction to deal with this, to tag pills in messages as "a mention", or "not a mention", by having the SDK reason about the message that the specific user there is mentioned or not, according to legacy and MSC3952 methods of mentioning.

clokep commented 1 year ago

Ruma's inclusion of the legacy push rules isn't abnormal or notable; we just rust-i-fy the matrix spec as-is, without cherry-picking, having only having minimally-opinionated approaches.

I did not realize ruma included the push rules processing -- I think it only contained types for the push rules themselves.

Including MSC3952 into ruma would be a similar process, so there should possibly be SDK-level functionality or abstraction to deal with this, to tag pills in messages as "a mention", or "not a mention", by having the SDK reason about the message that the specific user there is mentioned or not, according to legacy and MSC3952 methods of mentioning.

Yes, something along those lines will need to happen to know if the user meant to pillify the mention or not. The react-sdk generates mention information by interacting with the editor component directly (not just the raw message contents), which I think the rust-sdk or Ruma would also need to do.

Parsing of the mentions and handling the new push rules should be quite easy and fit into what Ruma already has.