Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Don't create a promise when preloading package settings in snapshot #19418

Merged
merged 1 commit into from May 30, 2019

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented May 29, 2019

Fixes #19374

Promise creation is forbidden within mksnapshot starting from Electron 3 (see electron/libchromiumcontent#363, nodejs/node#13242 and electron/electron#18420). Since preloading a package's settings is a synchronous action anyway, we just avoid instantiating a new Promise when calling loadSettings.

This fixes the crashes we were observing in #19373 when generating a new snapshot, and it is a prerequisite for shipping the Electron 3 upgrade after a hotfix with electron/electron#18426 is released.

Promise creation is forbidden within `mksnapshot` (see 
electron/libchromiumcontent#363, 
nodejs/node#13242 and 
electron/electron#18420). Since preloading a 
package's settings is a synchronous action anyway, we just avoid 
instantiating a new Promise when calling `loadSettings`.
@as-cii as-cii requested a review from rafeca May 29, 2019 15:49
Copy link
Contributor

@rafeca rafeca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@as-cii
Copy link
Contributor Author

as-cii commented May 30, 2019

I think the failures are unrelated to this pull request, so I'll go ahead and merge.

@as-cii as-cii merged commit a2e71f4 into master May 30, 2019
@as-cii as-cii deleted the as/no-promises-in-mksnapshot branch May 30, 2019 06:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in mksnapshot when building with Electron 4
2 participants