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

Element Web R stuck on syncing, on refresh rooms start appearing only when someone sense a message, after enabling Rust encryption #26604

Closed
dinosmm opened this issue Nov 17, 2023 · 6 comments
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs

Comments

@dinosmm
Copy link

dinosmm commented Nov 17, 2023

Steps to reproduce

Enable rust encryption feature flag in config.json.

Refresh Element Web.

It logs me out, so I log back in.

It's stuck on syncing for a long time (longest I waited was 20 minutes).

Refresh, then it is logged in but it's empty. Rooms start showing only when someone else sends a message in the room.
Rooms are called " and 600 others" or similar, instead of their real names.
Then more rooms show (upon refreshing again), with the same name structure, under 'Historical', as if I have left them or not joined them.

Disabling the Rust encryption flag and logging in again makes everything appear normal.

Outcome

What did you expect?

I expected all my rooms and messages to show up as normal.

What happened instead?

Rooms only started appearing if someone else sent a message in that room. Room names were like " and 600 others" instead of the real name of the room.

Operating system

Debian server for hosting Element Web, Windows 10 for client browser

Browser information

Firefox 119.0.1

URL for webapp

1.11.49

Application version

1.11.49

Homeserver

Synapse 1.96.1

Will you send logs?

Yes

@florianduros florianduros added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience A-Element-R Issues affecting the port of Element's crypto layer to Rust labels Nov 20, 2023
@BillCarsonFr
Copy link
Member

BillCarsonFr commented Nov 24, 2023

Refresh shouldn't log you out. Something else happened.

The slow initial sync and bad room state should be fixed by matrix-org/matrix-js-sdk#3830 that has landed in element-web 1.11.50

@richvdh
Copy link
Member

richvdh commented Nov 24, 2023

Enable rust encryption feature flag in config.json.

Refresh Element Web.

It logs me out, so I log back in.

Looking at the rageshake logs:

2023-11-17T17:39:01.119Z D stopping OutgoingRoomKeyRequestManager
2023-11-17T17:39:01.120Z D stopping MatrixClient
2023-11-17T17:39:01.120Z D SyncApi.stop
...
2023-11-17T17:39:01.121Z D FetchHttpApi: --> POST https://<redacted server name>/_matrix/client/v3/logout

... That matches exactly what I would expect to see if you had deliberately logged out from the client, and seems to have happened before you refreshed the application.

@dinosmm
Copy link
Author

dinosmm commented Nov 24, 2023

Logging out must have happened because I had not opened Element Web on that browser for a while or something.

I have now updated to .50. If I enable Rust encryption, I can log in, but previous encrypted messages show as undecryptable. Is this expected?

@richvdh
Copy link
Member

richvdh commented Nov 24, 2023

Logging out must have happened because I had not opened Element Web on that browser for a while or something.

that doesn't seem to be what the logs show...

I have now updated to .50. If I enable Rust encryption, I can log in, but previous encrypted messages show as undecryptable. Is this expected?

It is expected that previous messages show as undecryptable on a new device, unless/until the keys can be downloaded from backup or retrieved from another device. We are continuing to work on the performance of Web R in this area.

@richvdh
Copy link
Member

richvdh commented Nov 24, 2023

Actually I may have been looking at the wrong bit of the log, but I see something very similar happening earlier:

2023-11-17T17:09:36.683Z D stopping OutgoingRoomKeyRequestManager
2023-11-17T17:09:36.683Z D stopping MatrixClient
2023-11-17T17:09:36.684Z D SyncApi.stop
...
2023-11-17T17:09:36.684Z D FetchHttpApi: --> POST https://<server>/_matrix/client/v3/logout

This looks to be the point that your client switched over to Rust crypto. You had been using that session for 15 seconds (with legacy crypto) up to that point. The next refresh happened at 17:12:01.

I don't think we need to dig into exactly what happened, but the point is: I'm pretty sure the logout is not connected with enabling rust crypto in the config.

@dinosmm
Copy link
Author

dinosmm commented Nov 24, 2023

Thank you so much for looking so deep into it!

The experience was that I enabled Rust encryption, then opened my Element Web, it spent a second or two loading and then it showed me the login screen (even though last time I had used it, it was left logged in), so in my initial post I assumed being logged off was something that enabling Rust encryption did - however, that doesn't really matter; I read that the setting persists when you are logged in so I would have logged out anyway to get Rust encryption to switch on.

The main problem was the infinite syncing and then rooms being gone, which .50 fixed.

unless/until the keys can be downloaded from backup or retrieved from another device.
I have my phone always logged in, presumably it should be able to get the keys from there? I left web with Rust on for several minutes but that didn't happen, so I turned Rust enc off again.
I know it's a work in progress and expect to find these things, I am just reporting it FYI. I'll look to see if anyone else has reported anything similar, and if not I will open a new issue if it persists.

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-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs
Projects
None yet
Development

No branches or pull requests

4 participants