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

Podio.OAuth not updated after OAuthStore.Set called in the async version #42

Open
LUS1N opened this issue Oct 20, 2017 · 1 comment
Open

Comments

@LUS1N
Copy link

LUS1N commented Oct 20, 2017

I implemented my own IAuthStore and after persisting it the Podio.OAuth doesn't get set to the new value.

I need to manually set it in the first place after construction, which is pretty silly, considering I pass the IAuthStore that holds PodioOAuth to the constructor:

_podio = new PodioAPI.Podio(podioClientId, podioClientSecret, podioOAuth) { OAuth = podioOAuth.PodioOAuth };

Since the IAuthStore.Set is called somewhere in the Podio library when I make a call to Podio, I can't know when to manually reset the Podio.OAuth object besides having a singleton PodioAPI object and keeping the record of IPodioOAuth.Set calls and then re-do the request to Podio after it fails and I reset the new OAuth object, because it was still trying to use the old OAuth, which apparently gets disposed of. At least that's what I assume from the ObjectDisposedException I get.

If I understand it correctly the old OAuth object get the dispose() call, but the new one is not set in it's place.

@LUS1N
Copy link
Author

LUS1N commented Oct 24, 2017

I think I was wrong on whats causing the issue. Most likely the task times out after refreshing the auth tokens. It takes about 2 minutes to throw the AggregateException that has TaskCancelled and ObjectDisposed exceptions.

If I repeat the request immediately after catching those it works fine. My current solution is to cancel that task after 10 seconds and run it again.

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

No branches or pull requests

1 participant