Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix chrome storage access scope #9951
I'm not sold on this approach personally, there are a lot of edge cases and things to handle when persisting things to disk. You definitely want to at least be using the async fs methods with some form of back-off and retry logic for when things don't work the first time.
You also need to recursively make the parent directories if they don't exist.
I'd much rather find a way to pass the persistence of this data off to Chromium logic that has already been battle tested
Definitely ok for using async
Do you have somthing in sight? I think every DOM storage methods will be scoped by domain and I'm not aware of other Chromium-based persistence methods already implemented and battle-tested.
I've implemented the use of async fs as well as recursive mkdir.
I'd be glad to do it, but how and why things would not work for the first time? Other parts of electron use persisted data on disk and it does not look like to me they implement some sort of back-off. Is that because we are on renderer side? If so, wouldn't be wise to centralise these access in the main process and deal via IPCs.
I've looked into Chromium's storage related to