Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where SDK returned annonymous function instead of return value specified in user code to the Functions Framework. #1324

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Dec 7, 2022

Given a FireAlerts-triggered function:

export const x = onInAppFeedbackPublished((event) => true);

Users will see following error logs:

x: Error serializing return value: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received type function ([Function (anonymous)])

While the error log isn't indicative of real errors (user code still runs and background function's return value are thrown away anyway), it's still annoying.

The root issue turned out to be that the wrapTraceContext that is suppose to wrap user-defined handler was called incorrectly in couple of places.

…e specified in user code to the Functions Framework.
@taeold taeold requested a review from kaibolay December 7, 2022 18:08
@taeold taeold merged commit 2c073d3 into master Dec 7, 2022
@taeold taeold deleted the dl-wrap-fix branch December 7, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants