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

FlurlParsingException when parsing created_at field from ListAccountsAsync() #52

Closed
lucaswalter opened this issue Feb 25, 2019 · 5 comments

Comments

@lucaswalter
Copy link

lucaswalter commented Feb 25, 2019

In my application I am attempting to iterate over each account and read in transaction data. During the API call I am getting this exception when the 'created_at' field is being parsed:

Flurl.Http.FlurlParsingException

Response could not be deserialized to JSON: GET https://api.coinbase.com/v2/accounts

Newtonsoft.Json.JsonSerializationException

Error converting value {null} to type 'System.DateTimeOffset'. Path 'data[7].created_at', line 1, position 4571.
Flurl.Http.Configuration.NewtonsoftJsonSerializer in Deserialize within Flurl.Http, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null
Flurl.Http.HttpResponseMessageExtensions+d__0`1 in MoveNext within Flurl.Http, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null
System.ArgumentException

Could not cast or convert from {null} to System.DateTimeOffset.

In my code I am trying to retrieve the accounts by calling:
var accountsResponse = await client.Accounts.ListAccountsAsync();

Am I doing something incorrect with this usage?

@bchavez
Copy link
Owner

bchavez commented Feb 26, 2019

Hello Lucas,

I don't know. You're probably not doing anything wrong, most likely Coinbase again not very clear with their documentation on the JSON schema being returned.

Please use Fiddler and enable the proxy debugging feature in CoinbaseClient.

var c = new Coinbase.CoinbaseClient();
c.EnableFiddlerDebugProxy("http://localhost.:8888")

Then post me the anonymized JSON you received that caused your CLR stack to pop. Once I have the JSON I should be able to write a unit test.

Thanks,
Brian

@lucaswalter
Copy link
Author

lucaswalter commented Feb 26, 2019

Thanks for the reply Brian,

Unfortunately this exception is only being thrown on a live web application when other users are connecting through their OAuth token. I was unable to replicate this on my own account or any of my friends accounts who have accessed the website. Each of the exceptions were reported on Sentry.

Will this need to be replicated locally before I can get you that JSON? Or is there anything else I can do to get you more context?

Thanks

@bchavez
Copy link
Owner

bchavez commented Feb 26, 2019

Hi Lucas,

Give Coinbase v5.0.7 a try. The new version should be published soon as this build is done:
https://ci.appveyor.com/project/bchavez/coinbase/builds/22646473

Keep an eye out and let me know if 91ff677 fixed the problem.

Thanks,
Brian

🚶 😎 "So don't delay... act now supplies are running out..."

@lucaswalter
Copy link
Author

Wow, thank you for such the fast response Brian! I'll get that updated as soon as that build is done.

Best,
Lucas

@bchavez
Copy link
Owner

bchavez commented Feb 26, 2019

No problem. 😎 Thanks for reporting the issue 👍

Just got the email notification: https://www.nuget.org/packages/Coinbase/5.0.7

bchavez added a commit that referenced this issue Feb 28, 2019
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

2 participants