Skip to content
This repository was 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
as-cii merged 1 commit into
masterfrom
as/no-promises-in-mksnapshot
May 30, 2019
Merged

as-cii merged 1 commit into
masterfrom
as/no-promises-in-mksnapshot

Conversation

@as-cii

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

Copy link
Copy Markdown
Contributor

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

@rafeca rafeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😍

@as-cii

as-cii commented May 30, 2019

Copy link
Copy Markdown
Contributor Author

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