skazantsev / WebDavClient

Asynchronous cross-platform WebDAV client for .NET Core
MIT License
155 stars 30 forks source link

Infinite blocking GetRawFile(...).Result on SECOND calls #53

Closed jeremy-waguet closed 4 years ago

jeremy-waguet commented 4 years ago

Since I upgraded to version 2.5.0, in my program I am using synchronous IO (since I am working in a Windows Form background worker)

Sample code:

var retRemoteGetTask1 = client.GetRawFile(filename1);
retRemoteGetTask1.Wait(); // Works !
var retRemoteResult1 = retRemoteGetTask1.Result; // retRemoteResult1 is fully filled

var retRemoteGetTask2 = client.GetRawFile(filename2);
retRemoteGetTask2.Wait(); // Infinite wait unless I break the debugger and "quick watch the retRemoteGetTask2 variable) !
//Quick Watching retRemoteGetTask2 : { Id = 41, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}" }
var retRemoteResult2 = retRemoteGetTask2.Result; // NEVER Reaching this line
skazantsev commented 4 years ago

Hi @jeremy-waguet ,

It looks like a regression bug due to a missing ConfigureAwait(false) :( I can release a fix today in a version 2.6.0. Thank you for bringing this up.

skazantsev commented 4 years ago

The version 2.6.0 is released in NuGet. I also unlisted the version 2.5.0 and marked it as deprecated in NuGet. Thanks for taking time to report it and sorry for inconvenience.

jeremy-waguet commented 4 years ago

Your welcome for this very quick fix !

Jeremy