-
Notifications
You must be signed in to change notification settings - Fork 46
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
10349 Bug: Idle Logout Issues (with automated tests) #5176
Conversation
…e alert modal bug and the infinite spinning wheel bug
…n sign out to avoid the modal appearing when no user is signed in
…t app behavior, and fixing a few typos
EDIT: After discussion, having the automated tests seemed better than not having them. If they ever become flaky or problematic to maintain, we can ditch them. Original comment below @jimlerza @zacharyrogers1 Could you take a look at the new testing paradigm here (don't worry about the other stuff for now) and see what you think? I'm happy to get rid of it all if you guys don't think it is worthwhile, but "it's working on my machine." The basic idea:
As far as I can tell, the pros:
The cons:
|
… to see if the cerebral update to constants is actually working in CI
…video artifacts suggest modal is not appearing
…o toggle instance management from cypress; tests *should* pass in CI now, if done correctly
… which tests fail
… some new actions for coordinating "DAWSON has been updated" messages across tabs; prevent idle sign out from signing out if DAWSON has been updated; begin adding tests
yes: [ | ||
checkClientNeedsToRefresh, | ||
{ | ||
clientDoesNotNeedToRefresh: [ | ||
setLogoutTypeAction(BROADCAST_MESSAGES.idleLogout), | ||
signOutSequence, | ||
setupCurrentPageAction('IdleLogout'), | ||
], | ||
// If the client needs to refresh, the sign-out will fail, | ||
// and this can lead to inconsistent front-end behavior. | ||
clientNeedsToRefresh: [], | ||
}, | ||
], |
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.
Although we clear the idle activity interval in IdleActivityMonitor, there is still be a brief period in which this could be called before the interval has been cleared.
|
||
if (user && !isUploading && idleLogoutState.state === 'INITIAL') { | ||
// Short-circuit here to prevent showing the "Are you still there?" modal, etc. when inappropriate | ||
if (!userIsLoggedIn || clientNeedsToRefresh) { |
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.
Originally, the "user is logged in?" check was short-circuiting, just like I have it here. Looking at the Git history, the check was accidentally moved into the first if
block. After moving it back out, I also refactored the if/else if
into multiple independent if
blocks for easier readability since this was an easy mistake to make.
// for some reason this causes jest integration tests to never finish, so don't run in CI | ||
if (!process.env.CI && !props.skipBroadcast) { | ||
if (!props.skipBroadcast) { |
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.
Nice catch!
See ticket for bug details.
There ended up being several issues related to idle sign-out behavior. Broadly, they were the following:
This PR enforces the following behavior: