Skip to content

Updated dialog warning handling for getExpiryTime #31

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aws-spenceng
Copy link
Contributor

@aws-spenceng aws-spenceng commented May 7, 2024

Issue #, if available: Addresses issue where in local environment, a false "Sign In" notification is shown due to the else condition handling

Originally, getExpiryTime has a numeric value <= 0 or -1 (the original value passed as null, see:

The conditional for the signInError triggered when the value of getExpiryTime <=0, which was the case as an empty expiryTime cookie still lead to expiryTime being populated as -1.

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aws-pangestu
Copy link
Contributor

aws-pangestu commented May 13, 2024

can you add the details with commands on how you built and tested this (I will also watch the video you provided)

okay I see you added them internally. nevermind

showWarningDialog();
}, warningTime);
if (getExpiryTime(sagemakerCookie) !== -1) {
if (timeToExpiry <= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, why do you use getExpiryTime() in 74 and timeToExpiry in 75, 77, 84, etc? is there a difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getExpiryTime and timeToExpiry refer to different values

  • getExpiryTime - is the value of the local expiryTime set by Code Editor. When the cookie is present, it gives the UNIX time of the expiry time (8 hours ahead of app start up). When no cookie is present, it returns -1
  • timeToExpiry - is the UNIX expiry time - the current time (8 hours). We use this to compare against 15 min to provide the warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants