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
feat: Redirect Electron/Chromium cache location #30665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if erased is automatically rebuilt from scratch with 'known' side effects (potentially have to re-enter credentials and re-fill forms, performance of a cold start, ...)
This may be expected for your perspective but for others this is an unacceptable breaking change to Electron that updating will result in cached data ceasing to exist.
This issue hasn't been fixed because no one has implemented a nice way of handling this that doesn't cause data loss.
It was already discussed at length in #8124, in particular: #8124 (comment). What is needed in electron is to provide to the electron-based app developers the possibility to define the 3 paths and by default assign them the currently used values, so no functional change results from the code change. Then each electron-based app dev team decides how to best proceed with the newly available options in their apps. |
Guess, there is some misunderstood, I did not break anything in term of functionality, I just offer a way to redirect the 'cache' to another location, there is no loss of data and the backward compatibility is preserved. |
f107842
to
559de6e
Compare
a839e59
to
728ecb7
Compare
@@ -610,6 +610,7 @@ Returns `String` - The current application directory. | |||
* `userData` The directory for storing your app's configuration files, which by | |||
default it is the `appData` directory appended with your app's name. | |||
* `cache` | |||
* `browserData` The directory for storing browsing data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note that it defaults to userData
?
// update when `name` is changed before `app.ready` is fired. So if app | ||
// isn't ready yet, invalidate the PathService cache to ensure a refresh. | ||
if (!Browser::Get()->is_ready()) { | ||
base::PathService::InvalidateCache(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache does not interfere with paths set by app.setPath
, it is mostly about the path providers, which we do not expose any JavaScript in Electron, so I think we can remove this InvalidateCache
call.
f984716
to
02ea9b6
Compare
@emmkimme could you have another look at this, please? |
Yes, will manage early next year, have a good end of year. |
No, we need a "breaking" change! (Quotes because cache location shouldn't matter at all to the app.) A transitionary period would be easy to implement, although more work than just changing the paths to something appropriate.
So we get a non-standardized mess instead of a bad standard? If they change it at all? No, thanks. Electron needs a fix, not the apps. |
To be fair, we are a bit lost. It seems to have a long discussion/context feed by experts on this area, and clearly, we are not and do not even pretend to be. We implemented this solution in our own Electron 4 years ago and it resolves the concerns of our customer which are on Citrix, VDI,... (see issues mentioned). We had the naive feeling it could help other people facing the same problem and as good citizen, we would like to contribute. If the general feedback is, this MR does not help at all, it is not even a first step to the right direction, too specific, raise more issues than the ones solved,... so it does not make sense to keep going. We will wait for a better contribution from the Electron community, hope it will |
@emmkimme are you still planning to work on this PR? |
The solution works fine on my side for more than 3 years and deployed with our product on hundreds of thousands users (Mac, Linux, Windows) without any issues. It fixes 5 and 7 years old issues which prevents Electron to manage properly Virtual Env. |
I'm continuing the work of this PR in #33554. |
************ DRAFT ***********
Description of Change
This MR fixes or help on the following issues:
Notes: This is a new version of feat: Custom cache path
Checklist
npm test
passesRelease Notes
What is managed the cache is a bit complicated to define.
As a matter of rules, what is in the cache is:
Additional notes
This change is backward compatible.
For concurrent access violation, the cache folder must not be shared by different users.
For performance purpose, it must be set on a fast drive.