Skip to content

Commit

Permalink
Update publish_composite.js
Browse files Browse the repository at this point in the history
Wait for all publications to finish processing initial added callbacks before calling this.ready()
  • Loading branch information
manueltimita authored Dec 7, 2023
1 parent 0b21bdb commit fa6facd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/publish_composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ function publishComposite (name, options) {
publications.forEach(pub => pub.unpublish())
})

// wait for all publications to finish processing initial added callbacks
await Promise.all(publications.flatMap(pub => pub.addedPromises));

debugLog('Meteor.publish', 'ready')
this.ready()
})
Expand Down

0 comments on commit fa6facd

Please sign in to comment.