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

Let call member events expire #3831

Merged

Conversation

robintown
Copy link
Member

This is to combat stale device data so clients can show an accurate view of who's actively participating in the call at all times. See matrix-org/matrix-react-sdk#8776 for a similar PoC implementation of this for Element Web's video rooms.

proposals/3401-group-voip.md Outdated Show resolved Hide resolved
`m.call.member` state events must be ignored if their user's `m.room.member` event's membership field is not `join`.
When sending an `m.call.member` event, clients should set the `m.expires_ts` value to one hour in the future. If the user stays connected for longer than an hour, the client must actively update the state event with a new expiration timestamp (for example, every 45 minutes to allow for some amount of clock desync between participants).

`m.call.member` state events must be ignored if the `m.expires_ts` field indicates they have expired, or if their user's `m.room.member` event's membership field is not `join`. They must also be ignored if the `m.expires_ts` value is more than 75 minutes in the future, to prevent uncooperative clients from getting themselves permanently shown as 'connected' by setting the expiration date to way in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, also: worth noting that call invites have a 'lifetime' field which is a duration for which it's valid after the "time of the event", the idea being that you can work that out by using the age field you get from the homeserver and then it doesn't rely on your clients' clocks being synced. This approach is much simpler and avoids using the (slightly contentious and difficult to use) age field but obviously relies on time being correct (ish) on clients. I think this is probably the right approach because 1) almost all user devices automatically NTP sync nowadays and 2) we're dealing with a much longer span of time than the amount of time a call rings for, so if a clock is off by a couple of minutes, it won't make much difference here (whereas for a call invite, it could mean the call would never ring at all).

In other words, I think this is correct, but could be worth noting in case we come back in several years and wonder why event expiry is handled differently between invites & group call member events.

@robintown robintown requested a review from dbkr June 10, 2022 14:23
@robintown robintown changed the title Expire m.call.member events after 1 hour Let call member events expire Jun 10, 2022
@dbkr
Copy link
Member

dbkr commented Jun 16, 2022

I'd say this is OK to go ahead & merge into Matthew's branch

@robintown robintown merged commit 7a06ed7 into matrix-org:matthew/group-voip Jun 16, 2022
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

Successfully merging this pull request may close these issues.

2 participants