bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
693 stars 147 forks source link

Awaiting the inner task instead of the outer task #77

Closed kernel32uiuc closed 7 years ago

kernel32uiuc commented 7 years ago

Task.Factory.StartNew returns a nested task (Task). Awaiting a nested task is dangerous so we should always unwrap the nested task (with Unwrap() or using Task.Run) and await the inner task.

kernel32uiuc commented 7 years ago

It failed due to an old version of TPL library. Replacing Task.Run with a double await (await await) and will send a new PR.