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

Failure to load/"Unable to restore session" error on Safari 15 #27445

Open
richvdh opened this issue May 7, 2024 · 4 comments
Open

Failure to load/"Unable to restore session" error on Safari 15 #27445

richvdh opened this issue May 7, 2024 · 4 comments
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@richvdh
Copy link
Member

richvdh commented May 7, 2024

Not being an Apple user myself, I can't reproduce this, but we have had some reports from users on Safari 15 of "Unable to restore session" errors.

Safari 15 is not one of our supported browsers but we should fail more gracefully.

It appears that, before Element R, you would get an application which mostly worked, but still didn't support encryption (rageshakes showed: Failed to load Olm). This is now worse, because failure to instantiate the crypto stack means that the application doesn't load at all (see also #27424).

[Context: the cause of the failure is our use of a script-src: "wasm-unsafe-eval" content security policy, which is unsupported on Safari 15 This is is required for any WASM to be loaded (see MDN. In theory you can also use script-src: "unsafe-eval", but this is dangerous).]

@richvdh richvdh added T-Defect S-Minor Impairs non-critical functionality or suitable workarounds exist O-Uncommon Most users are unlikely to come across this or unexpected workflow labels May 7, 2024
@dosubot dosubot bot added A-Element-R Issues affecting the port of Element's crypto layer to Rust S-Critical Prevents work, causes data loss and/or has no workaround labels May 7, 2024
@t3chguy
Copy link
Member

t3chguy commented May 7, 2024

Safari 15 is not one of our supported browsers but we should fail more gracefully.

According to our support policy this issue should be closed

Definition: Issues only affecting unsupported environments are closed

@richvdh
Copy link
Member Author

richvdh commented May 7, 2024

Can we not detect Safari 15 and show an error (in the same way that we do for browsers that are missing other required features)? I think we can do better than just close such issues out of hand.

@t3chguy
Copy link
Member

t3chguy commented May 7, 2024

Can we not detect Safari 15 and show an error (in the same way that we do for browsers that are missing other required features)?

We do feature detection, not browser detection for those. Modernizr doesn't seem to have a way to detect wasm-unsafe-eval support nor can I find one using JS. Safari also often obfuscates user agent details like claiming I'm on macOS Catalina (10.15.7) on this machine. Plus a lot of privacy extensions go further on this front so parsing UA should be avoided in favour of feature detection.

image

I think we can do better than just close such issues out of hand.

Then I suggest bringing this up as a topic of discussion in the weekly chapter meeting, otherwise this goes against policy.

@kegsay
Copy link
Contributor

kegsay commented May 24, 2024

Can we do the bad thing and just grep the error message then? Given it'll mention unsafe-eval: E Unable to load session Refused to create a WebAssembly object because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive:

The failure mode is pretty horrible, as it means as we roll out EW-R to more users, they will just end up with a broken app which won't load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

4 participants