-
Notifications
You must be signed in to change notification settings - Fork 523
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
Fixing exception InvalidOperationException while authentication #609
Conversation
… completion source set method is called repeatedly.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
LGTM! Did you sign the CLA? I want to marge it 👍 Thanks for fixing it! |
Yes, I did. From: Eyal Peled [mailto:[email protected]] LGTM! Did you sign the CLA? I want to marge it 👍 https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png Thanks for fixing it! — This email has been checked for viruses by Avast antivirus software. |
I don't find your name in the list of approved users. With which email did you sign it? |
Hm… I seem to lost that e-mail. I don’t know, I simply clicked on the link and then agreed to the terms. What e-mail was there… I guess this [email protected]. Sometimes I see different software systems change the e-mail to [email protected] and it works exactly the same. I cannot explain this phenomenon. Alex From: Eyal Peled [mailto:[email protected]] I don't find your name in the list of approved users. With which email did you sign it? — This email has been checked for viruses by Avast antivirus software. |
Alex, I can't find those two emails. Can you please try again? Thanks so much! |
Could you check again? I re-signed it. E-mail address is definitely [email protected]. See screenshots below. From: Eyal Peled [mailto:[email protected]] Alex, I can't find those two emails. Can you please try again? Thanks so much! — This email has been checked for viruses by Avast antivirus software. |
CLAs look good, thanks! |
Fixing exception InvalidOperationException while authentication
Thanks Alex for fixing it 👍 |
No problems. By the way, all other places which have Set calls instead of TrySet calls could be safely changed improving the overall stability. I didn’t check other places, I’m just saying that if you review the code and do it you won’t break anything you’ll eliminate possible issues. Frankly speaking, I don’t understand why Set methods were created in the first place. The whole concept of Task object as it was designed assumes single transition from one state to another and there is no point in throwing exception. From: Eyal Peled [mailto:[email protected]] Thanks Alex for fixing it 👍 https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png — This email has been checked for viruses by Avast antivirus software. |
It seems there is a rather serious problem with the GoogleWebAuthorizationBroker.AuthorizeAsync invocation. Somewhere deep inside the code flow there is WebAuthenticationBrokerUserControl class and the method OnBrowserNavigating. This method constantly throwing this exception
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
at System.Threading.Tasks.TaskCompletionSource`1.SetResult(TResult result)
at Google.Apis.Auth.OAuth2.WebAuthenticationBrokerUserControl.OnBrowserNavigating(Object sender, NavigatingEventArgs e)
at Microsoft.Phone.Controls.WebBrowser.FireNavigatingEvent(Uri uri, Boolean& cancel) at Microsoft.Phone.Controls.WebBrowserInterop.ReversePInvokeThunk.OnNavigating(Int32 webBrowserControlId, String uri, Boolean& cancel)
Changing Set methods to TrySet methods will resolve the issue. Why the method is called repeatedly and is this OK is a different question. Anyway changing the methods won't break anything, won't change the main logic but will fix the issue.