connor4312 / cockatiel

🐦 A resilience and transient-fault-handling library that allows developers to express policies such as Backoff, Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback. Inspired by .NET Polly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retry policies broken in 2.0.0

tomasAlabes opened this issue · comments

A policy creation like Policy.handleAll().retry().backoff(new ConstantBackoff(2000, 10)) fails with the following error:

Argument of type 'ConstantBackoff' is not assignable to parameter of type 'IBackoff<IRetryBackoffContext<unknown>>'.
  Property 'duration' is missing in type 'ConstantBackoff' but required in type 'IBackoff<IRetryBackoffContext<unknown>>'.
         .retry().backoff(new ConstantBackoff(2000, 10))
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/cockatiel/dist/backoff/Backoff.d.ts:18:14
    18     readonly duration: number;
                    ~~~~~~~~
    'duration' is declared here.

It works in version 1.1.1.

Node 12.19.1
Typescript 4.1.2

Thanks, fixed in 2.0.1