Closed anku255 closed 7 months ago
Name | Link |
---|---|
Latest commit | 49bf2653accdca06a807328f3f76d87e9ae64f4f |
Latest deploy log | https://app.netlify.com/sites/precious-marshmallow-968a81/deploys/655c94908a76290008824413 |
Name | Link |
---|---|
Latest commit | 49bf2653accdca06a807328f3f76d87e9ae64f4f |
Latest deploy log | https://app.netlify.com/sites/astounding-pegasus-21c111/deploys/655c949056d4ef0008fea681 |
Also, the AWS lambda PR check is failing.
Summary of change
In many frameworks, calling
req.body
orreq.formData
is limited to a single use due to their nature as readable streams. Our framework classes havegetJSONBody
andgetFormData
functions, designed to invoke the appropriate method on thereq
object.Calling these functions multiple times can lead to issues, as observed in #746. For instance, the
getJSONBody
was mistakenly called twice in the passwordReset API implementation. Although combining these calls into one resolved the specific case in #746, it does not prevent users from inadvertently triggering the same error by callinggetJSONBody
multiple times.To address this, we now cache the response of
req.body
orreq.formData
directly in the recipe implementation.Related issues
Test Plan
Tests were added to ensure that
getJSONFromRequestBody
andgetFormDataFromRequestBody
are invoked only once, regardless of the number of calls togetJSONData
orgetFormData
. If any framework class overrides the implementation ofgetJSONData
orgetFormData
from theBaseRequest
class, these tests would fail.Documentation changes
Checklist for important updates
coreDriverInterfaceSupported.json
file has been updated (if needed)lib/ts/version.ts
frontendDriverInterfaceSupported.json
file has been updated (if needed)package.json
package-lock.json
lib/ts/version.ts
npm run build-pretty
recipe/thirdparty/providers/configUtils.ts
file,createProvider
function.git tag
) in the formatvX.Y.Z
, and then find the latest branch (git branch --all
) whoseX.Y
is greater than the latest released tag.add-ts-no-check.js
file to include thatsomeFunc: function () {..}
).