matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.26k stars 246 forks source link

notification client: look for a non-stripped room member event for invites #4012

Closed bnjbvr closed 1 month ago

bnjbvr commented 1 month ago

The full invite event (including event id) might be present in the timeline section of a sliding sync response, so in theory we could look for a non-stripped room member event, and match the push notification event id against the invite event id from the timeline portion.

Needs a bit more investigation and confirmation by trying it out with a real-world synapse server.

bnjbvr commented 1 month ago

Note: the timeline events aren't handled by user-defined event handlers, when it comes to invited rooms. Adding support for that would be sufficient to solve the issue here, since both the SS proxy and native SSS seem to return the full invite event as part of the timeline (or required_state), for an invited room.

bnjbvr commented 1 month ago

This requires substantial changes in the SDK (i.e. providing the timeline to an invited room, despite sync v2 not providing any timeline events in that case), and this is working good enough right now, so it's probably not needed at the moment. Since this was for the context of notifications, implementing a more complete /room/ID/context endpoint would likely be more beneficial to all clients.