-
Notifications
You must be signed in to change notification settings - Fork 130
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
Fix(core): [On behalf of Lexmark International, Inc]: Check expiry be… #37
Conversation
Tried to run gulp tests but didn't find any, I see now that the tests are an npm step now. I'll look at what I broke Monday and try and get the tests up to date. |
I did a little more digging and it looks like this change is somehow interfering with tick(). Meaning that the call to expiry.now() is not returning a an incremented time value. |
Found the reason for test issues but unsure how to solve. Angular 2 tick only causes events to fire, it does not however, override time. This means that Date.now() isn't returning a time that is offset by the tick calls. My code is functioning correctly, but the tests fail due to tick not actually altering time. |
…fore toggling idle state
I see the approach you have, but I'm still thinking the best solution is to just add a new custom So sort of like with the LocalStorage functionality that was added, you can keep your CookieExpiry and then just add CookieInterruptSource with the cookie checking timer. The way I devised it is that Does that make sense? I can help you with a cookie interrupt source if need be. |
Hell we can even create a new optional module called |
The two problems I was trying to avoid were an infinite loop, and excessive polling. inifinite loop - I was worried that if I made the change to add the cookieExpiry triggering an interval that would cause watch to set the cookie again, which would set the cookie and cause an infinite loop. If you use force to skip setExpiry to prevent the loop you run into another problem. You have now extended the idle time by the full amount instead of the delta between idle and what was set in the cookie, this may not be a BIG issue but I still think it's incorrect. excessive polling - We know that we don't need to check idle again for at least what we set the interval to initially, so we shouldn't need to poll over-and over again every second. Thanks for your response, do you think your suggested approach tackles these issues? |
Any plans to add CookieExpiry and a new CookieInterruptSource? This would be great for managing across tabs and sub-domains |
@stevefarwell I have that code(cookie-expiry) for the sub-domain problem and am willing to PR(pending corporate approval) if it is desired by the project owner. |
@markmaynard let me know if I can help |
@markmaynard any chance on getting your cookie-expiry code? |
@markmaynard is there any chance on getting your cookie-expiry code? |
@sharathreddyt I'll try and work on it. |
@sharathreddyt @stevefarwell here is a gist of the expiry code for cookies: |
…fore toggling idle state
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Expiry is not checked for updated timeout before going idle:
#27
What is the new behavior?
Expiry is checked and if store timeout is greater than current time a new timeout is set and idle is not toggled.
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: