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
{{ message }}
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
This issue is refactoring some code that was implemented in PR #323. The original comment that suggested the change is below:
Let me explain from my perspective. And mine doesn't have to be right :)
The BrowserType creates and assigns the clean-up func stuff. So it's an internal detail of the BrowserType. Instead of Browser having a field of a clean-up function, Browser can call the BrowserProcess's clean-up function, or just tell it to close, I don't have a strong opinion about that.
I mean, the clean-up function can be a field in the BrowserType instead of Browser. since the Browser can already access BrowserProcess through the browserProc field and because of the previous reasons I explained.
Feel free to skip my suggestion if you don't want to tackle it now. It's OK 👍
In essence, Browser does not care about the cleanup and therefore should not be in charge of cleaning up of the temporary directory. The object that created the directory (i.e. BrowserType) should own the cleaning up of it.
For now there isn't a simple way to to do this, but BrowserType should at least own the cleanup code and there be a way for Browser to signal that it is closing that will enable BrowserType to perform the cleanup -- this could just be as simple as chain of calls from Browser -> BrowserType OR BrowserProc.
The refactor could go the extra mile and move the creation of the temp dir to a more suitable and maintainable place so that we're able to reason the creation and deletion in a single object.