Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Olm is prone to race conditions across multiple tabs #2325
Comments
richvdh
changed the title from
Olm is prone to race conditions
to
Olm is prone to race conditions across multiple tabs
Sep 21, 2016
richvdh
added
the
type:e2e
label
Sep 21, 2016
This was referenced Sep 22, 2016
richvdh
added
the
p1
label
Oct 3, 2016
|
I think this is important. |
richvdh
added
major
bug
labels
Oct 31, 2016
|
I've been doing some thinking about this. Implementing race-free concurrency between tabs via localstorage is hard, because Chrome (at least) just doesn't provide any promises in this area. We have no idea how long it takes a write in one process to be reflected in another, which makes any read-modify-write process inherently racy. Some options might be:
I guess we want to use IndexedDB with fallback to Localstorage. |
ara4n
added
p2
and removed
p1
labels
Dec 7, 2016
|
This causes corrupted olm sessions, so really does need to be p1 |
richvdh
added
p1
and removed
p2
labels
Dec 21, 2016
|
The situation is even worse with electron, which totally ignores updates which happen in another process: see electron/electron#2493. I have no idea how to fix this, currently. |
richvdh
referenced this issue
Jan 19, 2017
Open
"Unable to decrypt: The sender's device has not sent us the keys for this message." (The UISI bug) #2996
|
I can definitely reproduce this. Opening riot in two tabs (and sending messages from them) can break communication with peers in both directions. |
|
The secret third option is to bully people into only using one tab (but I don't like this). I like the idea of using IndexedDB; falling back to localstorage sounds like it will still have all the same problems when we do fall back - could we consider just not supporting firefox incognito until we have the bandwidth to carve out a reliable localstorage fallback option? |
lampholder
modified the milestones:
RW002 - candidates,
RW003 - candidates
Apr 3, 2017
lampholder
added to Ready to Start
in E2E Usability and Stability
Apr 12, 2017
lampholder
referenced this issue
in vector-im/riot-meta
Apr 12, 2017
Open
E2E stability and usability. #63
|
The electron app is now single-instance, so this should mitigate this on electron. |
|
This will also be a problem for syncing device lists. |
richvdh commentedSep 21, 2016
•
edited
If you have multiple tabs open for the same account, they will fight over the localstorage and corrupt each other.
Simple example: Two tabs run the "generate ephemeral keys" timer at the same time. They generate different keys, but only one set is successfully persisted in the Olm account. I suspect this has been happening to trilobite17, who likes to have multiple tabs open.
Another example: