fix(win): recover signing queue after transient errors#9657
fix(win): recover signing queue after transient errors#9657davidebaraldo wants to merge 4 commits intoelectron-userland:masterfrom
Conversation
🦋 Changeset detectedLatest commit: c8a4894 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add a rejection handler to the signingQueue promise chain so that a failure signing one file does not prevent subsequent files from being attempted. Each caller still receives the rejection for its own file. Closes electron-userland#9656
a8165ce to
b9c2992
Compare
|
Has this been tested per your PR description? I noticed the suggested code in the Description doesn't match the actual code change. Can you please clarify which approach is intended? |
mmaietta
left a comment
There was a problem hiding this comment.
Marking Request Changes until previous question is addressed
|
Hi @mmaietta — apologies for the confusion. The snippet in the description was from an earlier draft I revised before pushing; the committed code is the intended fix: const promise = this.signingQueue.then(() => this._sign(file))
this.signingQueue = promise.catch(() => false)
return promiseI went with this shape rather than the
I've updated the PR description to match the committed code. On testing: I haven't been able to commit a unit test yet. The queue lives inside Happy to invest in a proper integration test (e.g. mocking |
Summary
Fixes #9656.
When multiple files are signed in sequence,
WinPackager.signIf()chains them throughthis.signingQueueusing.then(). If any_sign(file)rejects, the queue enters a permanently rejected state and every subsequent.then()is skipped — so files queued after the failing one are silently never signed. WithforceCodeSigning: falsethe build then completes shipping unsigned binaries instead of signing the rest.Fix
Decouple the queue's internal state from the per-file result:
this.signingQueueis reset to a resolved promise after each operation (success or failure), so the next_signalways runs.promiseis returned to the caller, so rejections still propagate —forceCodeSigning: truestill throws, and the failing file's caller still sees its error.Test plan
forceCodeSigning: truestill throws on signing failure