Skip to content

Commit ad6cd43

Browse files
authoredMar 19, 2024··
Remove infinite wrapping of withInit (#1540)
* Remove infinite wrapping of withInit * Changelog
1 parent 0aaedc4 commit ad6cd43

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix bug where 1st gen functions eventually fail with stack too deep (#1540)
2+
Make simple CORS options static for improved debugability (#1536)

‎src/v1/cloud-functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ export function makeCloudFunction<EventData>({
367367
service,
368368
triggerResource,
369369
}: MakeCloudFunctionArgs<EventData>): CloudFunction<EventData> {
370+
handler = withInit(handler);
370371
const cloudFunction: any = (data: any, context: any) => {
371372
if (legacyEventType && context.eventType === legacyEventType) {
372373
/*
@@ -404,7 +405,6 @@ export function makeCloudFunction<EventData>({
404405
context.params = context.params || _makeParams(context, triggerResource);
405406
}
406407

407-
handler = withInit(handler);
408408
let promise;
409409
if (labels && labels["deployment-scheduled"]) {
410410
// Scheduled function do not have meaningful data, so exclude it

0 commit comments

Comments
 (0)
Please sign in to comment.