element-hq / element-hq/element-web

Fails to start after Chrome downgrade

Open
#27,520 1 comment 0 reactions 0 assignees View on GitHub
A-Storage O-Uncommon S-Critical T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

We had a crash report ([internal link](https://github.com/matrix-org/element-web-rageshakes/issues/25971)) on Chrome with errors in the logs like this:

```
2024-05-21T06:58:48.335Z E Error starting matrixclient store - falling back to memory store Cannot read properties of null (reading 'nextBatch')
TypeError: Cannot read properties of null (reading 'nextBatch')
```

and this:

```
2024-05-21T06:58:50.813Z E Unable to load session invalid type: null, expected a sequence at line 1 column 4
Error: invalid type: null, expected a sequence at line 1 column 4
```

## Symptoms

I think the symptoms of this would be that the page would remain blank when opening Element Web, and refreshing the page would not help.

## Cause

After reading the code, we believe that these error messages could only be caused if multiple pieces of data in IndexedDB were replaced by `null` values. The fact that at least two separate object stores were affected lead us to believe this is a browser behaviour rather than a bug in Element Web. We found no plausible code paths that would insert null values into these parts of the DB.

We found https://issues.chromium.org/issues/41308609 , which does suggest that nulls might be inserted **if the user opened the application in an earlier version of Chrome after having previously opened it into a later version**. This problem would persist even if the user switched back to the later version.

I am creating this issue for visibility, not necessarily expecting a fix within Element Web since we suspect it is caused by a Chrome bug.

## Workaround

A workaround for this issue is to clear the storage for Element Web entirely. (See e.g. [How to Clear Storage and Site Data for a Single Site on Google Chrome](https://www.howtogeek.com/664912/how-to-clear-storage-and-site-data-for-a-single-site-on-google-chrome/)). This will delete your cryptographic identity on this device and if you have no other devices you will lose access to your old messages.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.