-
Notifications
You must be signed in to change notification settings - Fork 94
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
Joining a room call in embedded mode sometimes fails within Element Web #2458
Comments
The HAR of the sync requests
This can be summarised as the following changes:
Looking at the DB we get
Which is roughly: Where bottom is most recent and background colour is the state groups. If you look at the DB output, which is ordered by |
My latest understanding of this issue is as follows, working through the layers: Synapse/Homeserver There is some suggestion (TODO: where?) that the might be circumstances were a sequence like this is valid within the spec. If this is the case then it possibly suggests that the client should be better at handling this. Element Web - js-sdk This explains the sequence of As a workaround, @toger5 has implemented matrix-org/matrix-js-sdk#4242 which implements a check to ignore some repeated room state events. The repeated case that is identified is where there is an immediate repeat (e.g. A -> B -> This doesn't address the general case of inconsistent data coming back from Synapse or indeed if there are spec compliant cases which need handling. Element Web - react-sdk implementation of embedded calls EW appears to process the end of embedded calls at two levels. Firstly, when the widget explicitly indicates a hangup (listener registered at https://github.com/matrix-org/matrix-react-sdk/blob/19f9f9856451a8e4cce6d313d19ca8aed4b5d6b4/src/models/Call.ts#L894) which marks the call as disconnected. Secondly, via the In the case of the room state coming out of sequence, the second method is being invoked on stale events. If the end call handling was based purely on the explicit hangup (or use interaction) then might we not need to process the state events in this way? Element Call |
One more thing, there was a suggestion that the behaviour in Synapse was triggered by EW/EC sending the events simultaneously to Synapse causing a race. I tried modifying EW/js-sdk et al to ensure that the events were sent sequentially but this didn't appear to help. I might not have done it correctly though. |
For some more context on this, I think the relevant points that need to be serialised are:
I think these are being triggered across different execution paths. In some places Promises are also being discarded rather than awaited. |
A
TLDR: |
The original behaviour in EW/EC is addressed by matrix-org/matrix-js-sdk#4242 in that we no longer rely on the homeserver sending the events in the correct/consistent order. The bug for the underlying issue in Synapse that causes it to return the inconsistent |
When running Element Call embedded within Element Web using the "New group call experience" labs feature I sometimes see a behaviour where I attempt to start a room call and after pressing "Join call" I get returned to the timeline rather than actually entering the call.
In the console you see
The widget died; treating this as a user hangup logged
@toger5 had spotted this previously and sent messages in #matrix-dev about it. The message describing when this was observed matches my own observations:
Here is how it looks from a UX point of view:
Immediate.hangup.after.re-starting.call.mov
When looking at it I also came to the conclusion that the sequence of room state events being (re-)emitted and (re-)processed by https://github.com/matrix-org/matrix-js-sdk/blob/d90292bff5ed026fba72b1ffa8b5284b1fb76577/src/matrixrtc/MatrixRTCSessionManager.ts#L133-L148 that causes an issue.
How I originally came on to this issue was that I was looking at #2415 and found that the key distribution failed after encountering this behaviour. I will add some context on that issue shortly too.
Possibly related issues:
js-sdk
data model you use.Thoughts:
MatrixRTCSessionManager
is not suitableThe text was updated successfully, but these errors were encountered: