-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Don't throw when trying to see if a stored password is a chunked password #150402
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
Don't throw when trying to see if a stored password is a chunked password #150402
Conversation
|
Ok, putting this up quick as a draft PR. Will look to discuss quick with @TylerLeonhardt . Here is the rundown. For Jupyter we add and delete secrets when deleting a secret that should be present the secret looks to be deleted, but the delete operation throws and we surface an error in our log. The tricky bit here is that I'm not able to repro this issue in Code-OSS, only in Code-Insiders were I don't have source maps (they time out trying to load) and I'm not currently able to debug well into the depths of the keytar service. However I was able to catch the exception at the point it was seen and I was able to locate the location in the obfuscated code and look at that. What I see is that we are failing on the first JSON.parse seen in the delete password code when looking to see if we are saved on a chunked password.
If I look up at getPassword, I see that the check for chunks is wrapped in a try catch fully, and if it failed, then it just returns back the password. Given this, I'm putting up this tentative PR that makes the code in deletePassword that also looks for chunked passwords safe with a try catch. Makes sense to me that if getPassword considers an exception from JSON.parse ok, then this code in delete password would also be ok to eat the error. My slight hesitation is that due to not being able to repro in Code - OSS or debug deeper into the service in shipping insiders I don't feel like I have a full root cause here. Given how the saving works I would expect that we would get something back that JSON.parse could operate on so it's not clear to me why it's throwing, or why it doesn't throw in Code - OSS. I do see the encrypted content that we are looking to save if that helps at all (this is encrypted value at the point we are passing to the cred service):
Options as I see it.
Note, this issue seems mostly benign since the key is deleted. But the throw does skip out on the rest of the function, so the event for password changed would not fire, could lead to hard to diagnose issues where it's deleted but the change is not see in an extension. Note: Since the chunking is Windows only I would say that I'm seeing this issue on MacOS. |
|
Per convo with @TylerLeonhardt I'm going to update the comment a bit with more info then submit this as a full PR. Will grab insiders in the morning to check if it's verified since it can't be verified on Code - OSS. |
This PR fixes #149104