You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently fiddle-core continually swaps the installed version (via Installer) into Paths.electronInstall as needed. Fiddle can have multiple windows, each with a different version of Electron selected. These two paradigms are at odds with each other since running two different fiddles with different Electron versions will cause the second run to try to replace the files of the first one.
The current approach has the distinct advantage that there's only ever one installed version extracted on disk, so even if no cleanup is performed, at worse the files for a single version remain extracted. The limitation on multiple installed versions is somewhat problematic, though. A better default behavior may be to use temp directories and have Runner remove them as clean up. This would be a breaking change.
The text was updated successfully, but these errors were encountered:
Hi @dsanders11 ,
I have been looking into this issue and wanted to share some thoughts about the clean up strategy.
While I understand your proposal to clean up in Runner when the fiddle is stopped, but this would require unzipping the Electron binary every time a fiddle runs, even when using the same version repeatedly.
I would like to suggest a potentially better approach:
Extract each version to a unique subdirectory without overwriting (as you suggested).
Clean up all these subdirectories when the Fiddle app closes, using app.on('window-all-closed') in main.ts of Fiddle Repo.
This way, each version only needs to be unzipped once.
Let me know your thoughts!
@AlokYadavCodes, you're right that unzipping for each fiddle run is less than ideal.
but this would require unzipping the Electron binary every time a fiddle runs, even when using the same version repeatedly.
To support #98 we'll still need to handle the case of separate copies of the same Electron version because the fuse settings might be different, and we need to have them isolated.
Building on what you've written, I think a viable approach would be:
Installer creates a temporary directory (using fs.mkdtemp) where it will unzip Electron versions instead of the current electronInstall directory. The directory name would be the name of the ZIP (e.g. electron-v31.7.3-darwin-arm64) prepended with a hash of custom fuse settings if there are any (that way there's only one copy of the version with any given fuse settings).
Add a new Installer.dispose method which Fiddle could call on close to dispose of these temporary files.
Currently
fiddle-core
continually swaps the installed version (viaInstaller
) intoPaths.electronInstall
as needed. Fiddle can have multiple windows, each with a different version of Electron selected. These two paradigms are at odds with each other since running two different fiddles with different Electron versions will cause the second run to try to replace the files of the first one.The current approach has the distinct advantage that there's only ever one installed version extracted on disk, so even if no cleanup is performed, at worse the files for a single version remain extracted. The limitation on multiple installed versions is somewhat problematic, though. A better default behavior may be to use temp directories and have
Runner
remove them as clean up. This would be a breaking change.The text was updated successfully, but these errors were encountered: