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

RoomListService should be able to update the room list when a room's notification setting is modified. #2574

Open
nimau opened this issue Sep 19, 2023 · 3 comments
Assignees

Comments

@nimau
Copy link
Contributor

nimau commented Sep 19, 2023

El-X displays the user-defined notification mode for each room in the room list:

  • Room list entry with notification mode set to mentions and keywords only
Screenshot 2023-09-15 at 14 36 01
  • Room list entry with notification mode set to mute
Screenshot 2023-09-15 at 14 30 52

Currently, the RoomListService knows nothing about the notification parameters, and the ffi layer adds the user-defined notification mode to the RoomInfo crate.
This works well for the initial construction of the room list, but if the push rules are updated in the account data, the RoomListService is currently unable to detect these changes.

As a work-around, El-X listens for changes to the push rules and rebuilds the room summaries whenever a change is detected.

Would it be possible to have this mechanism in the RoomListService (i.e. update the room list each time a room notification mode is updated)?

Here, we are only interested in user-defined push rules that have an impact on a room:

  • an Override rule with an EventMatch condition whose key is room_id
  • a Room rule

Note: the matrix-sdk notification_settings crate allows to get the user-defined notification for a room.

@Hywan
Copy link
Member

Hywan commented Sep 19, 2023

Which data should be updated from the RoomListService?

@nimau
Copy link
Contributor Author

nimau commented Sep 21, 2023

My understanding of the RoomListService is that it builds a diff of room IDs each time it receives a sync response. Do you think it could also build a diff when push rules are updated?
I realise that this means that each time it receive a sync update, it will need to get the user-defined notification mode for each room in the list and if the push rules have changed, check to see if there are any impacted rooms in order to build a new diff.

@Hywan
Copy link
Member

Hywan commented Sep 27, 2023

For the moment, we rely on the server to update the room. If an event is received for a particular room, this room will be updated. Either its position is changed, either its content is changed, or both. All these situations create an update of the room, so a new “diff” (when the position changes, it's a VectorDiff::Remove + VectorDiff::Insert, when the content changes but not the position, it's a VectorDiff::Set).

As soon as we migrate to client-side sorting, maybe we can apply our own logic, but for the moment, it's going to be really hard to get a mix of multiple sources of “updates”.

@Hywan Hywan self-assigned this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants