Repository navigation
fix(package): ensure electron-packager throws if fails - #3136
Merged
Merged
Conversation
erickzhao
force-pushed
the
fix/ensure-electron-packager-fail
branch
from
January 11, 2023 01:10
4ecc744 to
a6bce41
Compare
BlackHole1
approved these changes
Jan 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summarize your changes:
Fixes #3128
For context, we use some pretty ugly hacks for Electron Packager to work with Listr2 (without being written with Listr2 itself).
To make this work, there's a single
packagerPromiseresolving from theelectron-packagercall:forge/packages/api/core/src/api/package.ts
Lines 307 to 313 in 6a118c6
If this Promise rejects, then we catch it and reject it with an array of reject handlers from all subtasks declared above:
forge/packages/api/core/src/api/package.ts
Line 177 in 6a118c6
The problem here is that the
rejectsarray is empty in the first.catch(), so the error is caught but never propagated. Therefore, the CLI ends up stalling indefinitely.To solve this problem, we add the Promise reject handler from
targetsPromiseto therejectsarray so thepackagerPromisecatch clause has a validrejectstarget.