AlariCode / nestjs-rmq

A custom library for NestJS microservice. It allows you to use RabbitMQ or AMQP.
https://purpleschool.ru
MIT License
289 stars 40 forks source link

Bug Fix: Double ACK when a provider is exported multiple times #51

Closed falahati closed 2 years ago

falahati commented 2 years ago

Well, the title is self-explanatory,

this might happen when a provider or controller is exported multiple times, usually to have a named export and a symbol-based export to be used by local or independent modules.

in any case, when an instance is exported multiple times, we bind the same method multiple times which is a problem, so this PR now only checks each instance of the provider/controller once.

It is still possible to encounter such an issue, but for other use cases, the developer can change their code to go around this, however for specific use cases in which a single instance is exported multiple times, there is no way to go around the issue and therefore this patch was needed.

AlariCode commented 2 years ago

@falahati merged, thanks!