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 for bug stopping vault timeout to never #1618
Conversation
- use nullable int on settings page and in vault service
@@ -17,6 +17,6 @@ public interface IVaultTimeoutService | |||
Task LockAsync(bool allowSoftLock = false, bool userInitiated = false); | |||
Task LogOutAsync(); | |||
Task SetVaultTimeoutOptionsAsync(int? timeout, string action); | |||
Task<int> GetVaultTimeout(); | |||
Task<int?> GetVaultTimeout(); |
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 change makes me nervous, especially for a hotfix. As this is a new bug introduced with the custom timeout feature, it seems like a UI issue in Settings. Is there a way to handle the new option without modifying the service?
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.
We could replace the null
value we're saving for "Never" with a negative number, but that will require a much larger change on the settings page. Even if we did the bare minimum and left the variables as nullable, the max timeout policy was written under the assumption that the value for "Never" was null
. We just missed that with the underlying service.
I believe I've checked all the calls to the service, but we could try the negative number. What do you think?
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.
@mportune-bw I think I agree with @jlf0dev, the value should have been null-able from the beginning. (On the other clients, never is also represented as null
, and negative values tends to mark special actions like lock on restart, lock on inactivity.)
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.
I see what you're saying now. Let's get this in but let QA know regression is needed for vault timeout before we ship.
- use nullable int on settings page and in vault service
Type of change
Objective
When switching to the settings screen and selecting a timeout option of "Never", if you left the screen and returned the value reverted back to "Immediately".
The timeout preference option of "Never" is being saved as null in storage, but when we made the call to storage for the value we defaulted it back to "Immediately" if the value was null.
This fix removes the default value and instead allows the returned value to be null if the user selected "Never" as a timeout option.
Closes #1615
Asana Task: https://app.asana.com/0/1169444489336079/1201287480797899/f
Code changes
GetValueorDefault()
while selecting value.Screenshots
Testing requirements
Before you submit