aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

Await for the response messages and then put responses into list. #116

Closed petetheman79 closed 7 years ago

petetheman79 commented 7 years ago

When a WebHook is added with an invalid Uri (host does not exist etc) by using the noecho feature so that the WebHook uri is not validated, when the WebHookSender sends the message an exception is thrown in AzureWebHookDequeueManager line 281 when waiting for all Tasks to complete. This causes the rest of the code to not be executed. This causes a situation where all messages are resent indefinitely causing duplicate messages to be transmitted.

The solution that I have is to remove the Task.WhenAll(requestTasks) and rather to await on the _parent._httpClient.SendAsync(request) to ensure that exceptions while posting are handled in the exception handling block.

dnfclas commented 7 years ago

Hi @petetheman79, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

HenrikFrystykNielsen commented 7 years ago

Committed to dev branch as cb46ccaac71f9807f87d21af1ef4bc0783e6cb6c

syl20 commented 6 years ago

Hi, we experience some troubles with this bug and really need this fix :) Can you publish the updated nuget package ?

dougbu commented 6 years ago

Pre-release packages containing this fix are now available in the https://dotnet.myget.org/gallery/aspnetwebhooks feed.

syl20 commented 6 years ago

Thanks, we will test it with our development environment.

syl20 commented 6 years ago

Hi, we successfully test this package and it fixes our bug. Now waiting for the release. Thanks.