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
I maintain 2 packages @geersch/retry and @geersch/nestjs-retry. The former one offers a retry function supporting exponential backoff (powered by RxJS) and the latter allows you to use it via a NestJS interceptor.
@Controller('cats')classCatsController{
@Get()
@UseInterceptors(newRetryInterceptor(FixedBackoffStrategy))findAll(@Headers('x-attempt')header: number): string{return'all the cats';}}
This worked fine with NestJS 9.x.x, but with NestJS 10 it breaks and the tests of @geersch/nestjs-retry package fail. The retry operator which is eventually piped into the next.handle() observable does retry X times, but it appears that the actual controller method is not invoked more than once anymore, breaking the retry mechanism.
The automated tests (Github actions) fail for the @geersch/nestjs-retry package. See retry-interceptor.spec.ts for the failing tests. It's just a simple controller with a few controller methods and 4 tests which all fail.
You can reproduce this by cloning this repository, switching to the fix/nestjs10 branch and running the tests.
Yes, I think this PR caused this issue. I'm not 100 sure but the potential reason is that the handle method of the handler object is still calling nextFn(i + 1), but now it's not wrapped in a function.
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
PR #11142
NestJS version
9.4.2 -> 10.0.3
Describe the regression
I maintain 2 packages
@geersch/retry
and@geersch/nestjs-retry
. The former one offers a retry function supporting exponential backoff (powered by RxJS) and the latter allows you to use it via a NestJS interceptor.This worked fine with NestJS 9.x.x, but with NestJS 10 it breaks and the tests of
@geersch/nestjs-retry
package fail. The retry operator which is eventually piped into thenext.handle()
observable does retry X times, but it appears that the actual controller method is not invoked more than once anymore, breaking the retry mechanism.Minimum reproduction code
geersch/retry#5
Input code
I made PR where I update the dependencies to NestJS 10.0.3.
geersch/retry#5
The automated tests (Github actions) fail for the
@geersch/nestjs-retry
package. Seeretry-interceptor.spec.ts
for the failing tests. It's just a simple controller with a few controller methods and 4 tests which all fail.You can reproduce this by cloning this repository, switching to the
fix/nestjs10
branch and running the tests.Be sure to the
build
script (yarn build
) from the root first before running the tests.Expected behavior
I would expect the controller method to be retried when I pipe this into the RxJS retry operator.
Other
No response
The text was updated successfully, but these errors were encountered: