-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Add expire_ts compatibility to matrixRTC #4032
Conversation
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
f68a2a0
to
d797ac2
Compare
Signed-off-by: Timo K <[email protected]>
Signed-off-by: Timo K <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
src/matrixrtc/CallMembership.ts
Outdated
const relativeCreationTime = this.parentEvent.getTs() - this.createdTs(); | ||
if (this.data.expires_ts) { | ||
// With expires_ts we cannot convert to local time. | ||
// TODO: Check the server timestamp and compute a diff to local time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we already have a follow-up ticket for that TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed I refactored this to use its own class for tracking the server/client diff with unimplmeneted clock sync diffs.
(It actally computes the diff once we get an event with an age property and from that point on its using this offset)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refactor is now on a different branch so that we can merge this "low risk"/"lightweight" version.
We will do the server-client-time sync properly here: #4038
@@ -624,6 +624,9 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M | |||
}; | |||
|
|||
if (prevMembership) m.created_ts = prevMembership.createdTs(); | |||
if (m.created_ts) m.expires_ts = m.created_ts + (m.expires ?? 0); | |||
// TODO: Date.now() should be the origin_server_ts (now). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have the follow-up ticket for that TODO already?
05de2f0
to
348c37f
Compare
Signed-off-by: Timo K <[email protected]>
Currenlty we use a combination of two fields in the Call member state events (
created_ts
+expires
)We want to move to just use a
expire_ts
.This needs rethinking the logic behind syncing clients clocks.
created_ts
was mirring theorigin_server_timestamp
on update.But
expire_ts
can only be known when the clock sync is known.Checklist
Here's what your changelog entry will look like:
✨ Features