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

Unable to call fromCognitoIdentityPool on iOS (browser) - crashes #6542

Closed
3 of 4 tasks
raRaRa opened this issue Oct 4, 2024 · 3 comments
Closed
3 of 4 tasks

Unable to call fromCognitoIdentityPool on iOS (browser) - crashes #6542

raRaRa opened this issue Oct 4, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@raRaRa
Copy link

raRaRa commented Oct 4, 2024

Checkboxes for prior research

Describe the bug

I just noticed that Chrome on iOS devices fails when calling fromCognitoIdentityPool. But it works on my desktop machine just fine with Chrome and Safari.

Example code:

  this.cachedCredentials = await fromCognitoIdentityPool({
      // Required. The unique identifier for the identity pool from which an identity should be
      // retrieved or generated.
      identityPoolId: this.options.IdentityPoolId,
      clientConfig: { region: this.options.Region },
  })();

The error I get:

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

ERROR TypeError: JSON.stringify cannot serialize cyclic structures

Expected Behavior

I expect it to run through the last step where it errors out, which should log:

endpoints Resolved endpoint: {
  "headers": {},
  "properties": {},
  "url": "https://cognito-identity.eu-west-1.amazonaws.com/"
}

Current Behavior

Currently it errors on

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/credential-providers 3.664.0

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

Latest Chrome on iOS - Chrome: 129.0.6668.90

Reproduction Steps

Call fromCognitoIdentityPool from Chrome in iOS

Observed Behavior

This error comes: ERROR TypeError: JSON.stringify cannot serialize cyclic structures

Expected Behavior

I expect this to log out:

endpoints Resolved endpoint: {
  "headers": {},
  "properties": {},
  "url": "https://cognito-identity.eu-west-1.amazonaws.com/"
}

Possible Solution

N/A

Additional Information/Context

N/A

@raRaRa raRaRa added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
@zshzbh zshzbh self-assigned this Oct 7, 2024
@zshzbh
Copy link
Contributor

zshzbh commented Oct 10, 2024

Hey @raRaRa ,

Thanks for the feedback! Could you please add the following code so that we can see the request headers?

client.middlewareStack.add(next => async (args) => {
    console.log(args.request)
    const response = await next(args);
    console.log(response);
    return response;
   }, {step: 'finalizeRequest'}) 

Thanks!
Maggie

@zshzbh zshzbh added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2024
Copy link

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 21, 2024
Copy link

github-actions bot commented Nov 8, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants