-
Notifications
You must be signed in to change notification settings - Fork 367
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
Fixed issue with cache not retaining refresh token #333
Changes from all commits
a33e750
f40313e
cdde94e
9a113dd
b95dc7b
f042137
fbff51c
7adaa6e
2f1a443
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ describe('getTokenSilently', function() { | |
cy.toggleSwitch('local-storage'); | ||
|
||
cy.login().then(() => { | ||
cy.reload(); | ||
cy.reload().wait(5000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is there a new 5 second delay here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test intermittently fails because the UI isn’t ready yet, I’m hoping the delay will fix that. Seems to in the tests I’ve run locally, will see how it pans out over time. |
||
|
||
cy.get('[data-cy=get-token]') | ||
.click() | ||
|
@@ -82,7 +82,8 @@ describe('getTokenSilently', function() { | |
cy.toggleSwitch('use-cache'); | ||
|
||
cy.login().then(() => { | ||
cy.toggleSwitch('refresh-tokens').wait(250); | ||
cy.toggleSwitch('refresh-tokens').wait(1000); | ||
lbalmaceda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
win.localStorage.clear(); | ||
|
||
cy.get('[data-cy=get-token]') | ||
.click() | ||
|
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.
why is this call needed again if you already did this 2 lines above?
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.
This is a preexisting test from before this work went in, but essentially it tests that the cache is in one state right up to the expiry time, then as soon as the time advances onto the expiry time the cache should be in another state (i.e. it's been removed by a
setTimeout
).Here, 800ms is used because Luis had a calculation in that defines the expiry time as
Math.min(expiresIn, expTime) * 1000 * 0.8
, and theexpiresIn
for this test is defined as 1000ms.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.
Do you think something of the above, simplified of course, can be put as a comment to illustrate this testing intention? So future me follows it
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.
Done!