fix: override default CognitoIdentityClient config to remove assumption of fetch body support #5707
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #5332, #5534
Description of changes: Update CognitoIdentityClient to use the native fetch configuration, as this does not expect the environment to implement response.body as a ReadableStream, and is safe to use in any browser that has native fetch or polyfill.
This is a temporary fix. The real issue is in the
@aws-sdk-js-v3
repo, and a number of things are currently being discussed and reviewed:aws/aws-sdk-js-v3#1107
aws/aws-sdk-js-v3#1121
aws/aws-sdk-js-v3#1123
I put up this PR as a short-term fix as this is impacting myself, as well as @Stereobits, and unknown others, in production. Please note that this only fixes the usage of CognitoIdentityClient. There are other clients used in the analytics, interactions, predictions, and storage packages that are not fixed by this PR (but those will be fixed via either of the SDK PR's).
I have not tested this yet. Sorry for pushing up this PR without testing, but I have to run right now and wanted to get eyes on it preliminary. Any insight in to how the amplify packages are usually tested would be greatly appreciated.
Question: I updated dependencies, but no changes were made to yarn.lock, so I looked and could not find a yarn.lock in the repository, but I found a couple one-off package-lock.json's. Is this repo not using a lockfile?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.