authentication.getSession
can return 'stuck' authentication requests
#211406
Labels
bug
Issue identified by VS Code Team member as probable bug
insiders-released
Patch has been released in VS Code Insiders
microsoft-authentication
Issues with the Microsoft Authentication extension
verified
Verification succeeded
Milestone
Does this issue occur when all extensions are disabled?: Yes/No
Technically no, but that's because you need an extension to call the VS Code API.
Steps to Reproduce:
authentication.getSession()
withcreateIfNone: true
andsilent: false
authentication.getSession()
with the same scopes and options as beforeThe last step will hang indefinitely, with no exception thrown. It can be observed in the Azure Resources extension, but is not limited to that extension.
I believe this is similar to this issue/feature request.
What seems to be happening (thanks to @TylerLeonhardt for helping confirm this) is that VS Code has no way of detecting if the user has closed the browser tab, and so it cannot throw an error when this happens. There might be a timeout, but if there is, it is very long and users will be left wondering what has happened.
It is possible for extensions to implement cancellation themselves, which would just abandon the
getSession
call and allow users to invoke it again. But this doesn't work, becausegetSession
caches its requests and returns an existing promise, which in this case is blocked indefinitely. Thus, users cannot log in until they reload the window or restart VS Code.The text was updated successfully, but these errors were encountered: