bbc / sqs-consumer

Build Amazon Simple Queue Service (SQS) based applications without the boilerplate
https://bbc.github.io/sqs-consumer/
Other
1.71k stars 330 forks source link

[Bug]: Event listener on .once is called multiple times #393

Closed schaeferto closed 1 year ago

schaeferto commented 1 year ago

Describe the bug

When registering an event listener on a new consumer object using .once(), this listener is called multiple times.

Your minimal, reproducible example

https://stackblitz.com/edit/nestjs-typescript-starter-agfsxk?file=src/app.controller.ts

Steps to reproduce

Watch the console log statements.

Expected behavior

The event listener should only be called once.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Package version

v7.0.3

AWS SDK version

v3.316.0

Additional context

No response

nicholasgriffintn commented 1 year ago

Thanks for the issue and the reproduction, super helpful.

I'll take a look into this and get back the reason this might be happening.

schaeferto commented 1 year ago

Perfect. Thanks for your help!

nicholasgriffintn commented 1 year ago

This has been resolved in the version 7.1.0-canary.2:

https://stackblitz.com/edit/nestjs-typescript-starter-e4tyij?file=package.json

I don't know when 7.1.0 will be fully released, but the plan is to finish up just a couple more bits and then it will be released, the canary version should be perfectly fine to use in the meantime if this is an important issue for you.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.