element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.04k stars 1.96k forks source link

Running EW in two tabs may cause subtle nasty misbehaviour #21039

Open ara4n opened 2 years ago

ara4n commented 2 years ago

I think we’ve tied down the main splitbrain reliability problem with matrix-video-chat as being due to folks leaving instances running in background tabs. This means they keep a sync loop running for the same device in the other tabs, which race to consume to-device msgs with the fg tab. I think the race is something like:

This could affect device verif, possibly e2ee, and voip when msc3401 lands.

aaronraimist commented 2 years ago

Related: https://github.com/vector-im/element-web/issues/11088

jryans commented 2 years ago

As one potential approach, Hydrogen's service worker tracks concurrent session access, ensuring only one tab can access a session at a time.