File tree 6 files changed +9
-8
lines changed 6 files changed +9
-8
lines changed Original file line number Diff line number Diff line change
1
+ - Fix bug where some FireAlerts v2 functions didn't correctly return values back to Functions Framework. (#1324 )
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ export function onAlertPublished<T extends { ["@type"]: string } = any>(
215
215
const [ opts , alertType , appId ] = getOptsAndAlertTypeAndApp ( alertTypeOrOpts ) ;
216
216
217
217
const func = ( raw : CloudEvent < unknown > ) => {
218
- return wrapTraceContext ( handler ( convertAlertAndApp ( raw ) as AlertEvent < T > ) ) ;
218
+ return wrapTraceContext ( handler ) ( convertAlertAndApp ( raw ) as AlertEvent < T > ) ;
219
219
} ;
220
220
221
221
func . run = handler ;
Original file line number Diff line number Diff line change @@ -250,8 +250,8 @@ export function onNewTesterIosDevicePublished(
250
250
const [ opts , appId ] = getOptsAndApp ( appIdOrOptsOrHandler ) ;
251
251
252
252
const func = ( raw : CloudEvent < unknown > ) => {
253
- return wrapTraceContext (
254
- handler ( convertAlertAndApp ( raw ) as AppDistributionEvent < NewTesterDevicePayload > )
253
+ return wrapTraceContext ( handler ) (
254
+ convertAlertAndApp ( raw ) as AppDistributionEvent < NewTesterDevicePayload >
255
255
) ;
256
256
} ;
257
257
@@ -315,8 +315,8 @@ export function onInAppFeedbackPublished(
315
315
const [ opts , appId ] = getOptsAndApp ( appIdOrOptsOrHandler ) ;
316
316
317
317
const func = ( raw : CloudEvent < unknown > ) => {
318
- return wrapTraceContext (
319
- handler ( convertAlertAndApp ( raw ) as AppDistributionEvent < InAppFeedbackPayload > )
318
+ return wrapTraceContext ( handler ) (
319
+ convertAlertAndApp ( raw ) as AppDistributionEvent < InAppFeedbackPayload >
320
320
) ;
321
321
} ;
322
322
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ export function onOperation<T>(
152
152
}
153
153
154
154
const func = ( raw : CloudEvent < unknown > ) => {
155
- return wrapTraceContext ( handler ( convertAlertAndApp ( raw ) as BillingEvent < T > ) ) ;
155
+ return wrapTraceContext ( handler ) ( convertAlertAndApp ( raw ) as BillingEvent < T > ) ;
156
156
} ;
157
157
158
158
func . run = handler ;
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ export function onTestMatrixCompleted(
190
190
const specificOpts = optionsToEndpoint ( optsOrHandler ) ;
191
191
192
192
const func : any = ( raw : CloudEvent < unknown > ) => {
193
- return wrapTraceContext ( handler ( raw as CloudEvent < TestMatrixCompletedData > ) ) ;
193
+ return wrapTraceContext ( handler ) ( raw as CloudEvent < TestMatrixCompletedData > ) ;
194
194
} ;
195
195
func . run = handler ;
196
196
Original file line number Diff line number Diff line change @@ -28,6 +28,6 @@ export function wrapTraceContext(
28
28
// eslint-disable-next-line prefer-spread
29
29
return handler . apply ( null , args ) ;
30
30
}
31
- traceContext . run ( traceParent , handler , ...args ) ;
31
+ return traceContext . run ( traceParent , handler , ...args ) ;
32
32
} ;
33
33
}
You can’t perform that action at this time.
0 commit comments