The TryCatchRetry.RunWithDelayAsync(..) methods seem to work incorrectly because of the first argument - being Task or IAsyncOperation.
This line
await task;
doesn't actually re-run the task. It will always return the faulted task, so that whole purpose of the TryCatchRetry logic is lost.
Instead of receiving a Task argument, we should take a Func<Task> as the first argument.
You're most likely correct. Bonus points for a pull request and extra points for a unit test! :)
Sorry if I caused you trouble by adding untested code to the toolkit!
The
TryCatchRetry.RunWithDelayAsync(..)
methods seem to work incorrectly because of the first argument - being Task or IAsyncOperation. This lineawait task;
doesn't actually re-run the task. It will always return the faulted task, so that whole purpose of the TryCatchRetry logic is lost. Instead of receiving aTask
argument, we should take aFunc<Task>
as the first argument.Am I getting it wrong?