File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
meteor/server/publications/lib Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,13 @@ export function meteorPublishUnsafe(
5151
5252 const publicationGauge = MeteorPublicationsGauge . labels ( { publication : name } )
5353
54- Meteor . publish ( name , function ( ...args : any [ ] ) : any {
54+ Meteor . publish ( name , async function ( ...args : any [ ] ) : Promise < any > {
5555 publicationGauge . inc ( )
5656 this . onStop ( ( ) => publicationGauge . dec ( ) )
5757
58- return callback . apply ( protectStringObject < Subscription , 'userId' > ( this ) , args ) || [ ]
58+ const callbackRes = await callback . apply ( protectStringObject < Subscription , 'userId' > ( this ) , args )
59+ // If no value is returned, return an empty array so that meteor marks the subscription as ready
60+ return callbackRes || [ ]
5961 } )
6062}
6163
You can’t perform that action at this time.
0 commit comments