-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
Type: Breaking changeUsed to note any change that requires a major version bumpUsed to note any change that requires a major version bumpType: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PR
Description
Describe the need
I think there is a significant performance loss happening in this module.
Lets say we run the webhook middleware not in a cloud function. We get the payload, is a buffer and transform it as a string. Then we pass it to the hashing function, which is basically transforming it back to a buffer to hash it. When we validated, we do a JSON.parse.
What we could do is to keep them buffers, till we need it to be a string for JSON.parse.
In gcf we have request.body and request.rawBody. So we dont need to call JSON.parse.
Thats what I wanted to achieve in #936
Yes having a "getPayload" function is nice to encapsulate, but it is a potential performance bottleneck.
SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type: Breaking changeUsed to note any change that requires a major version bumpUsed to note any change that requires a major version bumpType: MaintenanceAny dependency, housekeeping, and clean up Issue or PRAny dependency, housekeeping, and clean up Issue or PR
Type
Projects
Status
🔥 Backlog