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

Missing ConfigureAwait(false) DeserializeResponseBody #455

Closed
thinkingserious opened this issue May 15, 2017 · 1 comment
Closed

Missing ConfigureAwait(false) DeserializeResponseBody #455

thinkingserious opened this issue May 15, 2017 · 1 comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: bug bug in the library

Comments

@thinkingserious
Copy link
Contributor

#453 (comment)

var dsContent = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content.ReadAsStringAsync().Result);

@thinkingserious thinkingserious added status: help wanted requesting help from the community type: bug bug in the library labels May 15, 2017
@thinkingserious thinkingserious added difficulty: easy fix is easy in difficulty hacktoberfest labels Sep 30, 2017
@Gimly
Copy link
Contributor

Gimly commented Sep 30, 2017

For now the DeserializeResponseBody method is not asynchronous, which is why ReadAsStringAsync is called synchronously (with the Result call). I propose to make DeserializeResponseBody asynchronous, and adding the ConfigureAwait(false).

To be coherent with the rest of the API, I would also propose to change the name to DeserializeResponseBodyAsync. Obviously both changes will make a breaking change. Will that be OK?

Gimly added a commit to Gimly/sendgrid-csharp that referenced this issue Sep 30, 2017
Issue sendgrid#455 asked to add `ConfigureAwait(false)` to the  DeserializeResponseBody's call to ReadAsStringAsync. Since that call was synchronous (with Result) the only reason to add the ConfigureAwait(false) was to make it async. This means also changing the method's name to be coherent with the rest of the library.

Fixes issue sendgrid#455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

2 participants