Skip to content
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

Properly support multiple tabs #26231

Open
marcusmueller opened this issue Sep 24, 2023 · 33 comments
Open

Properly support multiple tabs #26231

marcusmueller opened this issue Sep 24, 2023 · 33 comments

Comments

@marcusmueller
Copy link

Steps to reproduce

  1. I'm using an EMS-hosted element web 1.11.42
  2. As usual, I opened a second tab to go to the element URL in order to handle a coding related manner while keeping an eye on an organizational space, and participating in a documentation-related discussion

Outcome

What did you expect?

Second tab works, as it always used to – after all, having more than one window open is a very classical power-user workflow

What happened instead?

image

I got a message

Element is open in another window. Click "Continue" to use Element here and disconnect the other window.

and that's more than annoying. This makes element worse to use than a significant part of the competition, which we decided against a while back.

Operating system

Linux x86_64

Browser information

FF 117.0.1

URL for webapp

chat.gnuradio.org

Application version

Element version: 1.11.42 Olm version: 3.2.14

Homeserver

https://gnuradio.ems.host

Will you send logs?

No

@marcusmueller
Copy link
Author

marcusmueller commented Sep 24, 2023

This very very strong regression seems to have been introduced in matrix-org/matrix-react-sdk#11425. It is mentioned in the changelog under "Features", which is a miscategorization, on two fronts:

  1. It's not a feature, but was introduced to fix a bug, and
  2. it's a very strong functional regression.

The original bug that was fixed in matrix-org/matrix-react-sdk#11425 describes the taken approach as

A (somewhat hacky) option might be to lock out multiple tabs

and I'd concur; it's a very hotfix way of dealing with this. Since this requires a broadcast channel, there would be other (but potentially with downsides) ways of avoiding ratcheting races. The taken approach is understandable, but not without alternatives. This issue documents the user experience regression the taken approach entails.

@marcusmueller marcusmueller changed the title Element web sudenly refuses to work in multiple tabs Regression: Element web refuses to work in multiple tabs Sep 24, 2023
@t3chguy
Copy link
Member

t3chguy commented Sep 25, 2023

It's not a feature, but was introduced to fix a bug, and

Sure it is, it guards you against the footgun of using multiple tabs which had a low risk of data corruption, with rust crypto that risk went up so the necessity for such a guard was higher.

@t3chguy t3chguy changed the title Regression: Element web refuses to work in multiple tabs Properly support multiple tabs Sep 25, 2023
@t3chguy
Copy link
Member

t3chguy commented Sep 26, 2023

Blocked on #2503

@bornav
Copy link

bornav commented Sep 30, 2023

This makes it completely unusable for my use case
Reverting to v1.11.40, and freezing the automatic update till this is resolved

@marcusmueller
Copy link
Author

marcusmueller commented Sep 30, 2023

@t3chguy I'm trying to understand the technical side of this: Why is this blocked on #2503? We clearly have a channel to exchange the "there's another instance running" information, why not use that for arbitrating access to the ratchet?

Is implementing @ara4n's proposed webworker really the only way out of this regression? It feels like saying "blocked on this core architectural aspects" makes it unattainable to fix this.

@t3chguy
Copy link
Member

t3chguy commented Sep 30, 2023

The channel uses a very rudimentary lock in localstorage. The Rust crypto stack needs to only run in one place due to heavy leveraging of caches, abstracting all crypto calls via serialisation in localstorage would be dreadful for performance. If you feel the Rust crypto stack should be less restrictive then please open an issue on its tracker.

@marcusmueller
Copy link
Author

Thanks for the clarification! Much appreciated that you point me in the right directions 👍

@ChristianMayer
Copy link

It's not a feature, but was introduced to fix a bug, and

Sure it is, it guards you against the footgun of using multiple tabs which had a low risk of data corruption, with rust crypto that risk went up so the necessity for such a guard was higher.

It's not a feature. It's a huge UX regression.

That it was introduced to fix something deemed even worse (and probably is even worse) doesn't stop it from being an UX regression. Preventing users from using multiple tabs is a broken UX design.

@xarinatan
Copy link

I ran into this issue today somehow, but without having multiple tabs open. No amount of refreshing and restarting Firefox would fix the issue, eventually I cleared the cookies/site data for that domain and everything was fine and dandy again.

@bornav
Copy link

bornav commented Oct 7, 2023

@xarinatan did you update the element client, same happened to me when I updated the client

@xarinatan
Copy link

@bornav I'm not entirely sure what triggered it, my laptop ran out of power (so the browsing session was force-closed while on standby) so that could be a reason, I have a system that automatically updates the Matrix/Element containers to whatever's the latest tag on docker's registry so it could've been updated in that time, too.

Once it was triggered there was no way to resolve it without clearing the cookies/session storage for Element though. I restarted Firefox, ctrl+reloaded the page as well as just re-opening the page and browsing back to the main domain, to no avail, until I reset the aforementioned data.

@xarinatan
Copy link

I'm having the same issue again, different machine this time, again the only solution is to completely reset the cookies/local site data for Matrix.. I doubt I'm the only one who runs into this if it happens this often.

It's seemingly onset by laptops having ran out of power while in standby, I bet there's a very simple locking mechanism that just marks the session as locked when Element is initialized, but that means if the browser is ended incorrectly it'll cause Element to think its session is unavailable when it's not.

@marcusmueller
Copy link
Author

@xarinatan you're describing a separate issue, as far as I understand it, namely that single-tab-ensurance mechanism has a bug. So, please fill in a separate issue. Help the maintainers – keep separate issues separate, a bug tracker is not a discussion forum. Thank you!

@exercismnow

This comment was marked as off-topic.

@richvdh

This comment was marked as off-topic.

@Zer0-

This comment was marked as off-topic.

@lunera-dev

This comment was marked as off-topic.

@t3chguy

This comment was marked as off-topic.

@lunera-dev

This comment was marked as off-topic.

@t3chguy

This comment was marked as off-topic.

@lunera-dev

This comment was marked as off-topic.

@t3chguy

This comment was marked as off-topic.

@osresearch

This comment was marked as off-topic.

@Reactongraph

This comment was marked as off-topic.

@t3chguy

This comment was marked as off-topic.

@Reactongraph

This comment was marked as off-topic.

@t3chguy

This comment was marked as off-topic.

@ctrlbrk42
Copy link

@Reactongraph an unrelated issue is not a support forum. Rust crypto is no longer disableable as per its removal from https://github.com/element-hq/element-web/blob/develop/docs/labs.md#use-the-rust-cryptography-implementation-feature_rust_crypto-in-development

Hi,

Is this thread still current -- broken multiple tabs (due to crypto module/E2EE)?

I've been working to try and enable multiple tab support as well, and I don't need E2EE. So this news of the module being removed was new to me.

I'm trying to understand why the issue still exists if the module was removed?

@t3chguy
Copy link
Member

t3chguy commented Jul 25, 2024

@ctrlbrk42 the module was not removed, the labs flag for it has, it is now the only supported module. Thus as it cannot be disabled, you cannot simply skip the legacy variant from the build as was previously supported.

@ctrlbrk42
Copy link

@ctrlbrk42 the module was not removed, the labs flag for it has, it is now the only supported module.

Ok thank you. So does that mean there is no longer any possibility of multiple tab support? This issue should be closed as "won't fix"? Or is there still a plan to solve it?

My entire project requires no E2EE and also requires multi-tab, so I'm doing my best to understand the current state.

I get this isn't a support forum but I've spent weeks trying to solve this on my own. So I guess I'm asking for a little pity lol 😂.

I would offer a bounty or whatever it takes to solve this issue.

Thank you for taking time to respond.

@marcusmueller

This comment was marked as off-topic.

@t3chguy
Copy link
Member

t3chguy commented Jul 25, 2024

Or is there still a plan to solve it?

That's up to the crypto team, if they had thought its a wont-fix I'd have expected they would have closed this by now

@richvdh
Copy link
Member

richvdh commented Jul 25, 2024

Speaking from the crypto team: we hope to fix it one day, but it is not currently a priority.

My entire project requires no E2EE and also requires multi-tab, so I'm doing my best to understand the current state.

Possibly you could build a fork of Element that disables E2EE support, and also disables the multi-tab check; but bear in mind that's not a configuration we support or test, so it's hard to say what brokenness you would encounter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests