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

Revoke public interface change. #876

Merged
merged 2 commits into from
Apr 17, 2020
Merged

Revoke public interface change. #876

merged 2 commits into from
Apr 17, 2020

Conversation

terencefan
Copy link
Member

No description provided.

@terencefan terencefan force-pushed the revoke branch 3 times, most recently from 443f951 to 0eaa4af Compare April 17, 2020 02:51
@@ -143,7 +143,7 @@ public Task<string> GenerateClientAccessToken(string hubName, string userId = nu
{
claimsWithUserId.AddRange(claims);
}
return _endpointProvider.GenerateClientAccessTokenAsync(hubName, claimsWithUserId, lifeTime);
return _endpointProvider.GenerateClientAccessTokenAsync(hubName, claimsWithUserId, lifeTime).Result;
Copy link
Member Author

@terencefan terencefan Apr 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick fix of #861 . We don't actually have this method awaitable at this moment.

But it would probably cause a deadlock if you embed a Task.Wait inside an async method.
(Task.Result does things that similar to Task.Wait)
https://stackoverflow.com/questions/13140523/await-vs-task-wait-deadlock

So try avoiding doing something like this:

async Task Get(){ var token = manager.GenerateClientAccessToken; }

We will provide an async version of this API later on another PR.

@terencefan terencefan merged commit fe14711 into Azure:dev Apr 17, 2020
@terencefan terencefan deleted the revoke branch April 17, 2020 03:13
@vicancy vicancy mentioned this pull request Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants