Closed watfordsuzy closed 7 months ago
I also noticed that BoxConfig.RetryStrategy
is only used within the Auth handler and isn't propagated to the HttpRequestHandler
. This seems like an oversight.
Unfortunately adding a new parameter to the HttpRequestHandler
constructor, which already has two optional parameters, would be a breaking change. If that's okay to take, I'm happy to provide that fix as well.
I don't think we would make a breakthrough change for such a small change at this point. But if it were possible to extend HttpRequestHandler
with an optional argument and modify the SDK to use it in a non-breaking way, that would probably be fine.
@mwwoda I put together a non-breaking way to share the IRetryStrategy
with HttpRequestHandler
:
Nice! Maybe, you could create a PR based on this, so we can discuss it here?
Description of the Issue
Within the ExponentialBackoff retry strategy, the
Random
instance is recreated each timeGetRetryTimeout
is called. This is an anti-pattern, and incorrect for .NET Framework based projects:https://learn.microsoft.com/en-us/dotnet/api/system.random.-ctor
Note: this does not apply to Box.V2.Core, but they share the same repository.
Steps to Reproduce
ExponentialBackoff.GetRetryTimeout
calls in a row on .NET Framework 4.6.2+ targetsExpected Behavior
A single
Random
instance is used in accordance with .NET Framework best practices.Error Message, Including Stack Trace
N/A
Screenshots
N/A
Versions Used
.Net SDK: Box.V2 5.7.0 Windows: N/A