element-hq / element-web

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

"Something went wrong" with low bandwidth mode and E2EE #11138

Closed pacien closed 5 years ago

pacien commented 5 years ago

Description

On one of my device, a previously working Riot desktop session broke. Edit: after enabling low-bandwidth mode and trying to view an encrypted room On 1.4.1, nothing but a blank screen appears when launching the app. After upgrading to 1.4.2, nothing but a "Something went wrong" screen (probably the one added in https://github.com/vector-im/riot-web/issues/11009) appears.

Clearing the cache and reloading the app has no effect.

Oddly enough, the tray indicators works and displays the unread message count.

The Electron developper console shows a few exceptions in the log snippet that follows. The last exception is a rendering issue that might be the cause of the problem.

Console log snippet
rageshake.js:107 Error: End-to-end encryption disabled
    at oe.getKeyBackupEnabled (client.js:1189)
    at t.render (RoomView.js:1892)
    at ya (react-dom.production.min.js:173)
    at va (react-dom.production.min.js:172)
    at Zs (react-dom.production.min.js:247)
    at qs (react-dom.production.min.js:216)
    at Gs (react-dom.production.min.js:210)
    at Ms (react-dom.production.min.js:206)
    at react-dom.production.min.js:114
    at t.unstable_runWithPriority (scheduler.production.min.js:20)
    at po (react-dom.production.min.js:113)
    at _o (react-dom.production.min.js:114)
    at go (react-dom.production.min.js:113)
    at Is (react-dom.production.min.js:204)
    at Object.enqueueSetState (react-dom.production.min.js:127)
    at t.E.setState (react.production.min.js:13)
forEach.e.(anonymous function) @ rageshake.js:107
Ma @ react-dom.production.min.js:187
Ka.n.payload @ react-dom.production.min.js:201
Bo @ react-dom.production.min.js:122
Uo @ react-dom.production.min.js:123
va @ react-dom.production.min.js:170
Zs @ react-dom.production.min.js:247
qs @ react-dom.production.min.js:216
Gs @ react-dom.production.min.js:210
Ms @ react-dom.production.min.js:206
(anonymous) @ react-dom.production.min.js:114
t.unstable_runWithPriority @ scheduler.production.min.js:20
po @ react-dom.production.min.js:113
_o @ react-dom.production.min.js:114
go @ react-dom.production.min.js:113
Is @ react-dom.production.min.js:204
enqueueSetState @ react-dom.production.min.js:127
E.setState @ react.production.min.js:13
(anonymous) @ MatrixChat.js:1003
c @ bluebird.js:5290
D._settlePromiseFromHandler @ bluebird.js:3302
D._settlePromise @ bluebird.js:3359
D._settlePromise0 @ bluebird.js:3404
D._settlePromises @ bluebird.js:3484
p @ bluebird.js:190
f @ bluebird.js:183
l._drainQueues @ bluebird.js:199
drainQueues @ bluebird.js:69
Promise.then (async)
a @ bluebird.js:4517
l._queueTick @ bluebird.js:208
d @ bluebird.js:140
D._fulfill @ bluebird.js:3430
D._resolveCallback @ bluebird.js:3222
F @ bluebird.js:3509
_onWorkerMessage @ indexeddb-remote-backend.js:206
rageshake.js:107 Error: End-to-end encryption disabled
    at oe.getKeyBackupEnabled (client.js:1189)
    at t.render (RoomView.js:1892)
    at ya (react-dom.production.min.js:173)
    at va (react-dom.production.min.js:172)
    at Zs (react-dom.production.min.js:247)
    at qs (react-dom.production.min.js:216)
    at Gs (react-dom.production.min.js:210)
    at Ms (react-dom.production.min.js:206)
    at react-dom.production.min.js:114
    at t.unstable_runWithPriority (scheduler.production.min.js:20)
    at po (react-dom.production.min.js:113)
    at _o (react-dom.production.min.js:114)
    at go (react-dom.production.min.js:113)
    at Is (react-dom.production.min.js:204)
    at Object.enqueueSetState (react-dom.production.min.js:127)
    at t.E.setState (react.production.min.js:13)
forEach.e.(anonymous function) @ rageshake.js:107
value @ ErrorBoundary.js:109
Ka.i.componentDidCatch.n.callback @ react-dom.production.min.js:201
Go @ react-dom.production.min.js:125
jo @ react-dom.production.min.js:125
Ws @ react-dom.production.min.js:238
t.unstable_runWithPriority @ scheduler.production.min.js:20
po @ react-dom.production.min.js:113
Hs @ react-dom.production.min.js:230
Ms @ react-dom.production.min.js:206
(anonymous) @ react-dom.production.min.js:114
t.unstable_runWithPriority @ scheduler.production.min.js:20
po @ react-dom.production.min.js:113
_o @ react-dom.production.min.js:114
go @ react-dom.production.min.js:113
Is @ react-dom.production.min.js:204
enqueueSetState @ react-dom.production.min.js:127
E.setState @ react.production.min.js:13
(anonymous) @ MatrixChat.js:1003
c @ bluebird.js:5290
D._settlePromiseFromHandler @ bluebird.js:3302
D._settlePromise @ bluebird.js:3359
D._settlePromise0 @ bluebird.js:3404
D._settlePromises @ bluebird.js:3484
p @ bluebird.js:190
f @ bluebird.js:183
l._drainQueues @ bluebird.js:199
drainQueues @ bluebird.js:69
Promise.then (async)
a @ bluebird.js:4517
l._queueTick @ bluebird.js:208
d @ bluebird.js:140
D._fulfill @ bluebird.js:3430
D._resolveCallback @ bluebird.js:3222
F @ bluebird.js:3509
_onWorkerMessage @ indexeddb-remote-backend.js:206
rageshake.js:107 The above error occured while React was rendering the following components: 
    in RoomView
    in div
    in t
    in div
    in LoggedInView
    in t
    in MatrixChat
forEach.e.(anonymous function) @ rageshake.js:107
value @ ErrorBoundary.js:110
Ka.i.componentDidCatch.n.callback @ react-dom.production.min.js:201
Go @ react-dom.production.min.js:125
jo @ react-dom.production.min.js:125
Ws @ react-dom.production.min.js:238
t.unstable_runWithPriority @ scheduler.production.min.js:20
po @ react-dom.production.min.js:113
Hs @ react-dom.production.min.js:230
Ms @ react-dom.production.min.js:206
(anonymous) @ react-dom.production.min.js:114
t.unstable_runWithPriority @ scheduler.production.min.js:20
po @ react-dom.production.min.js:113
_o @ react-dom.production.min.js:114
go @ react-dom.production.min.js:113
Is @ react-dom.production.min.js:204
enqueueSetState @ react-dom.production.min.js:127
E.setState @ react.production.min.js:13
(anonymous) @ MatrixChat.js:1003
c @ bluebird.js:5290
D._settlePromiseFromHandler @ bluebird.js:3302
D._settlePromise @ bluebird.js:3359
D._settlePromise0 @ bluebird.js:3404
D._settlePromises @ bluebird.js:3484
p @ bluebird.js:190
f @ bluebird.js:183
l._drainQueues @ bluebird.js:199
drainQueues @ bluebird.js:69
Promise.then (async)
a @ bluebird.js:4517
l._queueTick @ bluebird.js:208
d @ bluebird.js:140
D._fulfill @ bluebird.js:3430
D._resolveCallback @ bluebird.js:3222
F @ bluebird.js:3509
_onWorkerMessage @ indexeddb-remote-backend.js:206

Steps to reproduce

See https://github.com/vector-im/riot-web/issues/11138#issuecomment-541815687

15710522892788

Version information

t3chguy commented 5 years ago

Where did you install this version from? It seems incorrectly built without encryption support

pacien commented 5 years ago

This is from the NixOS package which is based on the official pre-compiled release of riot-web.

The same package works on my other laptop and I'm able to send and receive messages in encrypted rooms, so the package is indeed supporting encryption.

The "something went wrong" screen appears only on one of my device. I suspect that it's trying to show a room which crashes the whole app instead of only one component after the upgrade to React 16.

t3chguy commented 5 years ago

That doesn't line up with the error which was thrown: https://github.com/matrix-org/matrix-js-sdk/blob/c9527685422ad9e158773d35622a4cd87b02d20e/src/client.js#L1036

pacien commented 5 years ago

Could the crash of one component prevent the crypto part from being initialised if it happens early? I checked both installations and their checksums are matching, and the package does support E2EE.

I think that this session might be stuck on a broken room. I've tried setting mx_last_room_id in the Local Storage in the developper tools, but it keeps resetting itself to its current value. Is there any way I can set it to another value for testing purposes?

t3chguy commented 5 years ago

Could the crash of one component prevent the crypto part from being initialised if it happens early? I checked both installations and their checksums are matching, and the package does support E2EE.

Crypto starts before any of the app gets mounted (other than the Spinner)

pacien commented 5 years ago

I've been able to identify the problem: I think there's a bug with the experimental low-bandwidth mode and end-to-end encryption support:

Since Riot automatically re-opens the last viewed room, the error appears right on start, not allowing the user to disable the low-bandwidth mode without the help of the console.

I've been able to go to another room by setting window.location.href = "vector://vector/webapp/#/room/[another room without encryption] and refreshing, allowing me to access the settings and disable the low-bandwidth mode.

turt2live commented 5 years ago

Encryption is intentionally not supported in low bandwidth mode, which is why this is a labs flag.

pacien commented 5 years ago

Why close this issue though? It should really not lock the entire app with an error page asking for a bug report, without allowing the user to disable that mode.

Furthermore, what is the rationale for disabling E2EE in low bandwidth mode?

t3chguy commented 5 years ago

Furthermore, what is the rationale for disabling E2EE in low bandwidth mode?

e2ee key negotiation uses a lot of bandwidth.

Why close this issue though? It should really not lock the entire app with an error page asking for a bug report, without allowing the user to disable that mode.

Because its in Labs and this is expected behaviour

turt2live commented 5 years ago

The low bandwidth option is meant to be paired with specific infrastructure. When you're not using that infrastructure, it has minimal value.

mureni commented 4 years ago

I am encountering this exact error, since there was no indication in the Labs setting that it was not compatible with E2EE. Have not yet figured out how to "reset" since Element takes me directly to the "Something went wrong" page without any way to change this.

Suggestions: 1) Make it clear that enabling Low-Bandwidth mode in the Labs will cause this problem 2) Use UX elements to hide or disable E2EE rooms when in Low-Bandwidth mode 3) Allow for users to edit their settings when "Something" goes wrong and/or add a button to reset labs flags