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
[PS-1137] Fix reseed storage #4543
Conversation
The check for the set vault-timeout needs to happen before all cleaning stateService Remove check inside of reseedStorage as happens outside prior to calling it (logout/settings.component)
Execute on all browsers besides Safari as it does not support chrome.storage.local.get with an empty key https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get
if (currentVaultTimeout == null) { | ||
// Skipping Safari as it does not support retrieving all data from localStorage via an empty key | ||
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get | ||
if (this.platformUtilsService.isSafari) { |
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 not equivalent to the replaced code. For example, firefox would be skipped in the previous, but not here.
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 expected as I wanted to remove the previous limit completely with d7f71aa but had to include Safari as it would throw with an empty key
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 believe the limitation was due to logging practices, not api limitations. I have not specifically looked at other browsers but to my memory this came about due to specifically chrome logging local storage values.
Is that not the case? I would prefer to not reseed storage unless needed for security.
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 have also not heard about any logging-issue related to this on other browser than Chrome-based ones. I had no issues testing FF with or without the changes, so thought I'd remove/loosen the check. Reverted my last commit
This reverts commit d7f71aa.
Type of change
Objective
On logout we call stateService.clean to remove the account. The check for vault-timeout in reseedStorage will always return null as the account was already cleaned. The check needs to be done beforehand.
Code changes
.clean()
)Before you submit