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

Many redundant requests, even though properly caching #671

Closed
bloveless opened this issue Apr 16, 2018 · 6 comments
Closed

Many redundant requests, even though properly caching #671

bloveless opened this issue Apr 16, 2018 · 6 comments
Assignees
Labels
Analytics Related to analytics

Comments

@bloveless
Copy link
Contributor

bloveless commented Apr 16, 2018

Do you want to request a feature or report a bug?

I think this is a bug. Or a misunderstanding on my part.

I checked here https://docs.aws.amazon.com/cognito/latest/developerguide/limits.html and didn't see any specific rate limits for the GetCredentialsForIdentity, but wanted to make sure before I invested too much time into this.

What is the current behavior?

On every page load, even though I can see my token, identity id, expires at date in my local storage I get at least two requests to https://cognito-identity.us-west-2.amazonaws.com/ AWSCognitoIdentityService.GetCredentialsForIdentity

I'm wondering if this a bug since everything is cached and the expires_at date has not passed yet.

We've had rate limiting issues with Cognito in the past when we mistakenly sent a request to Cognito on every page load. I assumed that switching to AWS-Amplify would remove these HTTP posts.

Is the GetCredentialsForIdentity function rate limited?

You can see my current implementation in this PR #665

What is the expected behavior?

I expected that I would see a request to https://cognito-identity.us-west-2.amazonaws.com/ only once every 5 minutes, not on every page refresh.

@richardzcode richardzcode added the Auth Related to Auth components/category label Apr 16, 2018
@jordanranz jordanranz added the Cognito Related to cognito issues label Sep 24, 2018
@stormit-vn
Copy link

I also facing this issue too, sometimes it sends to Cognito 6 times with the same request

@MatteoGioioso
Copy link

Same issue here, every time I switch tab and go back, Amplify is sending exactly 2 requests

@powerful23
Copy link
Contributor

@MatteoGioioso these two requests are sent as the session event for the Pinpoint Analytics. If you do not want the auto tracking feature, you can turn it off in your Analytics configuration: https://aws-amplify.github.io/docs/js/analytics#manual-setup

@MatteoGioioso
Copy link

@powerful23 Thank you!

@mlabieniec mlabieniec added Analytics Related to analytics and removed Auth Related to Auth components/category Cognito Related to cognito issues labels Oct 23, 2018
@mlabieniec
Copy link
Contributor

Looks like this is solved per the above feature. Please feel free to reopen if you are still having issues with the auto tracking disablement.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analytics Related to analytics
Projects
None yet
Development

No branches or pull requests

7 participants