element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Fails to start after Chrome downgrade

Open andybalaam opened this issue 1 year ago • 1 comments

We had a crash report (internal link) 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). This will delete your cryptographic identity on this device and if you have no other devices you will lose access to your old messages.

andybalaam avatar Jun 04 '24 14:06 andybalaam

We should detect any errors encountered in the service worker and should display them to the user.

MidhunSureshR avatar Jun 19 '24 09:06 MidhunSureshR