Skip to content

Commit c561af8

Browse files
fix(packager): wait for artifactCreated completion event before starting an upload (#6625)
When the configuration has an artifactBuildCompleted callback that is a Promise, the upload starts anyway as it listens to the artifactCreated event. This resolves that by first waiting for any hooks, then dispatching the event.
1 parent 98c9850 commit c561af8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/angry-starfishes-divide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix(packager): wait for event before starting an upload

packages/app-builder-lib/src/packager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ export class Packager {
271271
}
272272

273273
async callArtifactBuildCompleted(event: ArtifactCreated): Promise<void> {
274-
this.dispatchArtifactCreated(event)
275-
276274
const handler = resolveFunction(this.config.artifactBuildCompleted, "artifactBuildCompleted")
277275
if (handler != null) {
278276
await Promise.resolve(handler(event))
279277
}
278+
279+
this.dispatchArtifactCreated(event)
280280
}
281281

282282
async callAppxManifestCreated(path: string): Promise<void> {

0 commit comments

Comments
 (0)