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

Reliable Storage: Investigate persistent storage for Electron #9338

Closed
jryans opened this issue Apr 1, 2019 · 1 comment
Closed

Reliable Storage: Investigate persistent storage for Electron #9338

jryans opened this issue Apr 1, 2019 · 1 comment
Assignees
Labels
A-Storage Storage layer of the app, including IndexedDB, local storage, etc. P1 T-Enhancement

Comments

@jryans
Copy link
Collaborator

jryans commented Apr 1, 2019

Electron devs claim all origins should have "durable" storage. However, we have observed IndexedDB being pruned by Electron just as it can be by browsers.

Investigate the details of Electron's behaviour here and try to ensure it always persists.

@jryans jryans self-assigned this Apr 1, 2019
@jryans
Copy link
Collaborator Author

jryans commented Apr 2, 2019

Affected Users

Anecdotally, I have historically seen debug logs come in where Electron users are seeing the crypto store re-create itself, which tends to suggest that data has been evicted in the same way that it can happen in normal browsers. We haven't seen more such logs arrive since we added more logging about storage state, so it's currently unclear if Electron uses are actively affected in the field.

We are also now tracking storage state in analytics, so we can watch that over time to see if there are any events from Electron users.

Code Analysis

To summarise, it appears Electron should allow IndexedDB to use as much space as it likes and should never delete it arbitrarily.

Lab Simulation

I forced Riot to store its profile on a small drive inside a VM to observe what happens. The Electron policy seems to work as designed. I was able to store data until the drive had no space left. IndexedDB survived multiple Riot restarts.

No Space Left

When your entire drive runs out of space, IndexedDB does still explode in ways we don't yet catch, including spinners that block using the app. However, since Riot only supports place its config on your primary drive, presumably you'd notice you are out of space in other ways like OS warnings, etc. Riot should recover with a restart once there's more space.

Summary

It appears from both code inspection and lab testing that Electron should persisting data as desired, so there's no code change to make here. We should keep watching analytics to see if the issue still affects Electron users and investigate again if it does.

@jryans jryans closed this as completed Apr 2, 2019
@jryans jryans mentioned this issue Apr 2, 2019
5 tasks
@jryans jryans added the A-Storage Storage layer of the app, including IndexedDB, local storage, etc. label Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Storage Storage layer of the app, including IndexedDB, local storage, etc. P1 T-Enhancement
Projects
None yet
Development

No branches or pull requests

1 participant