Skip to content
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

Support cancelation in getSession #113270

Open
HuihuiWu-Microsoft opened this issue Dec 22, 2020 · 5 comments
Open

Support cancelation in getSession #113270

HuihuiWu-Microsoft opened this issue Dec 22, 2020 · 5 comments
Assignees
Labels
authentication Issues with the Authentication platform feature-request Request for new features or functionality
Milestone

Comments

@HuihuiWu-Microsoft
Copy link

  • VSCode Version: 1.51.1
  • OS Version:

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
Copy link
Author

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

@RMacfarlane RMacfarlane added the bug Issue identified by VS Code Team member as probable bug label Dec 28, 2020
@RMacfarlane RMacfarlane added this to the Backlog milestone Dec 28, 2020
@RMacfarlane RMacfarlane added the authentication Issues with the Authentication platform label Dec 28, 2020
@TylerLeonhardt
Copy link
Member

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
Copy link
Author

I just tried and it still exists on 1.56.1

@TylerLeonhardt
Copy link
Member

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:

  • Allow passing in a cancelation token so that extensions can cancel getSession requests that they fire
  • Auth providers need a way to handle that cancelation (so we need to funnel that cancelation token down)
  • Allow some kind of force mechanism to force cancel the current getSession and start a new one (this is for places you don't have reference to the cancelation token)

I will rename this issue and label it a feature request

@TylerLeonhardt TylerLeonhardt changed the title Can't show auth prompt again when getSession() after user close prompt page in browser Support cancelation in getSession May 18, 2021
@TylerLeonhardt TylerLeonhardt added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels May 18, 2021
@HuihuiWu-Microsoft
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication Issues with the Authentication platform feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants