WooCommerce.NET icon indicating copy to clipboard operation
WooCommerce.NET copied to clipboard

wc.Customer.UpdateRange(cb).Result hanging without error

Open hdnhdn opened this issue 3 years ago • 3 comments

Make sure you have included the below details when open an issue. Thank you.

  • Wordpress version, WooCommerce version and WooCommerce.NET version WooCommerce: 0.8.3 WooCommerce.NET Wordpress: Version 5.7.2 WooCommerce: Version 5.4.1

  • Steps to replicate the issue

if i make an update over update range is hanging no response no error no timeout. the application is hanging day and week on..

the problematic line ist the Result Dim c = wc.Customer.UpdateRange(cb).Result

work Dim c = wc.Customer.UpdateRange(cb)

  • Details of the error message if there is any no error no timeout only hanging. its happend without update on booth side...

hdnhdn avatar Jun 22 '21 19:06 hdnhdn

The Probleme ist after installing Microsoft Update KB5003637 when i delete it it works perfekt..

after reinstalling KB5003637 the update is hanging again..

hdnhdn avatar Jun 24 '21 07:06 hdnhdn

Anny News?

hdnhdn avatar Jul 05 '21 09:07 hdnhdn

(Note that I don't know VisualBasic - I'm assuming it works more or less like the similar C# code would work, so I may be wrong)

Do you really need to use .Result? Doing so is a recipe for deadlocks unless you know what you're doing.

The general recommendation is to avoid .Result whenever possible, and instead always use await.

That you say Dim c = wc.Customer.UpdateRange(cb) works confirms my hypothesis that this is your problem. However, Dim c = wc.Customer.UpdateRange(cb) is still not the correct way to call UpdateRange.

Please read this: https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/concepts/async/ You really should be familiar with async programming if you wish to use WooCommerce.NET (or most of dotnet, actually.)

(If you already know all of this and this is not your issue then I'm sorry for what I wrote)

gaazkam avatar Jul 09 '21 11:07 gaazkam