element-hq / element-call

Group calls powered by Matrix
https://call.element.io
Apache License 2.0
535 stars 84 forks source link

Sender key distribution unreliable when running in embedded mode #2415

Open hughns opened 1 month ago

hughns commented 1 month ago

When running as a widget (embedded mode) within Element X and Element Web, there have been reports of participant sender keys not finding their way to other recipients. This has resulted in those recipients not able to decrypt the media and so shows a grey box instead.

Apparently it is intermittent. This could be in the widget API interface or somewhere else. The keys are distributed via encrypted room events.

Whilst there is discussion about moving key distribution to use to-device messaging instead of encrypted room events for other reasons, it is not known if the root cause of the problem would also affect an alternative implementation

Possible next steps:

toger5 commented 1 month ago

Thanks for the detailed report!

I think it is clear from your comment that you are talking about the first case, but can you confirm:

fkwp commented 1 month ago

maybe https://github.com/matrix-org/matrix-js-sdk/issues/4198 is related

hughns commented 1 week ago

I think it is clear from your comment that you are talking about the first case, but can you confirm:

  • This happens when using calls initiated in EX or EW that run inside the matrix room.

Yes, this is the case.

hughns commented 1 week ago

I have been able to find one reproducible issue:

  1. Start a room call using "new group call experience" on device A and have https://github.com/element-hq/element-call/issues/2458 occur
  2. When the call rings on another device (device B) then hit Join on device B
  3. Complete joining on device B
  4. Then try to join on device A again by hitting the Join bannter
  5. Complete joining on device A
  6. Then you find that device A is missing the encryption key for device B

In this video device A is on the left and device B is on the right:

https://github.com/element-hq/element-call/assets/6955675/037c0e1d-0901-4acf-895b-13db49923d8b

(n.b. device A is running a customised version which shows decryption errors across the top of the media)