-
Notifications
You must be signed in to change notification settings - Fork 928
Cache App Check debug token #5055
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
Conversation
🦋 Changeset detectedLatest commit: b837c72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
4610ce3
to
36dd305
Compare
const storageWriteStub = stub(storage, 'writeTokenToStorage'); | ||
stub(reCAPTCHA, 'getToken').resolves(fakeRecaptchaToken); | ||
stub(client, 'exchangeToken').resolves(fakeRecaptchaAppCheckToken); | ||
storageWriteStub.resetHistory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does resetHistory do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the stub persists from test to test, it clears the call history so "calledOnce" is true even if it's called every time, but considering the stubs are all cleared and re-made after each test it's not needed here. Removed.
Changeset File Check
|
Cache the debug token to memory and indexedDB in a separate place from the regular app check token. Otherwise it will hit the exchange endpoint on every
getToken()
call and cause 429 (too many requests) errors.Fixes #5052