microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.4k stars 29.33k forks source link

Support cancelation in getSession #113270

Open HuihuiWu-Microsoft opened 3 years ago

HuihuiWu-Microsoft commented 3 years ago

Steps to Reproduce:

  1. Using the example code github-authentication-sample. Open extension and execute command 'Github authentication example', then a prompt in browser shows 2.close the page
  2. In vs code, execute the command again
  3. Prompt didn't showup(1.50.1 doesn't have the issue)

Does this issue occur when all extensions are disabled?: Yes

HuihuiWu-Microsoft commented 3 years ago

@RMacfarlane I don't if this is due to some usage change on the getSession() API, please let me know if it is.

TylerLeonhardt commented 3 years ago

Hi @HuihuiWu-Microsoft 👋

I recently gained ownership of the auth feature and so I'm getting ramped up!

It's been few versions now... Can you confirm if you're still seeing this issue?

Thanks!

HuihuiWu-Microsoft commented 3 years ago

I just tried and it still exists on 1.56.1

TylerLeonhardt commented 3 years ago

So I got some more context on this.

At one point, we changed this to the current behavior because extensions were firing getSession multiple times and causing the user to see several modals and open multiple browser windows.

With that said, you've found the downside of waiting for previous sessions to finish...they get closed and you can't successfully get getSession to return a session until the previous one times out.

My proposal for solution is:

I will rename this issue and label it a feature request

HuihuiWu-Microsoft commented 3 years ago

Thanks