You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be an option mismatch in the RetryHandler.
Reproducible By
constclient=newClient("http://localhost:3000").compose(retry({retry: function(err,context,callback){console.log("retrying",{err: err.code,state: context.state,opts: context.opts.retryOptions,});if(context.state.counter>=context.opts.retryOptions.maxRetries){callback(err);return;}// Both the docs and types made me thing that context.opts.retryOptions.minTimeout // should exist as an option but it in reality is context.opts.retryOptions.timeoutsetTimeout(()=>callback(null),context.opts.retryOptions.timeout);},}),minTimeout: 400,// here it is called minTimeout);
Expected Behavior
Either the property in the code should be changed from timeout to minTimeout or the docs + types should be updated to reflect the difference.
Logs & Screenshots
in retry-handler.js of undici v6.9.0 on line 40
classRetryHandler{constructor(opts,handlers){const{ retryOptions, ...dispatchOpts}=optsconst{// Retry scopedretry: retryFn,
maxRetries,
maxTimeout,
minTimeout,
timeoutFactor,// Response scoped
methods,
errorCodes,
retryAfter,
statusCodes
}=retryOptions??{}this.dispatch=handlers.dispatchthis.handler=handlers.handlerthis.opts=dispatchOptsthis.abort=nullthis.aborted=falsethis.retryOpts={retry: retryFn??RetryHandler[kRetryHandlerDefaultRetry],retryAfter: retryAfter??true,maxTimeout: maxTimeout??30*1000,// 30s,timeout: minTimeout??500,// .5s. // <=== here we are setting the value to timeouttimeoutFactor: timeoutFactor??2,maxRetries: maxRetries??5,
...
Environment
macOS Ventura 13.2.1
node 20.11.1
npm 10.2.4
Additional context
I am willing to open a PR myself if needed.
The text was updated successfully, but these errors were encountered:
Bug Description
There seems to be an option mismatch in the RetryHandler.
Reproducible By
Expected Behavior
Either the property in the code should be changed from
timeout
tominTimeout
or the docs + types should be updated to reflect the difference.Logs & Screenshots
in
retry-handler.js
ofundici
v6.9.0 on line 40Environment
macOS Ventura 13.2.1
node 20.11.1
npm 10.2.4
Additional context
I am willing to open a PR myself if needed.
The text was updated successfully, but these errors were encountered: