This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Fix File -> Open… menu on macOS
#25709
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.63 introduced a regression on the
File->Open…menu because Electron 10-11 changed how v8 snapshot files are named on macOS: they now have ax86_64orarm64suffix depending on the platform they're built for.Due to that the
getDefaultPathfunction in the main process doesn't have a valid value for the globalatomvariable, which is actually set from that snapshot.It is not really necessary, since the main process cannot access any of the editor stuff, so that function could just remove
undefinedand that's it. However we wanted to make sure we used the snapshot file as it improves the launch time of the app.Props to @niik for finding out the reason behind this obscure bug, I didn't even know Electron could do this v8 snapshot magic 😂 👏