onify / fake-amqplib

fake nodejs amqplib
MIT License
3 stars 0 forks source link

assertQueue(undefined) doesn #4

Closed fred-o closed 2 years ago

fred-o commented 2 years ago

When calling channel.assertQueue(undefined) a new queue name is generated and returned to the caller, but that name is not used in the call to broker.assertQueue(). Further attempts to use the generated queue results in Channel closed by server: 404 (NOT-FOUND) with message "NOT_FOUND - no queue 'amqp.gen-ceebcaa686' in vhost '/' `

fred-o commented 2 years ago

The fix for this would be to change this line https://github.com/onify/fake-amqplib/blob/default/index.js#L151 to

          const queue = broker.assertQueue(queue, {...options, _connectionId: connection._id}, ...args);
paed01 commented 2 years ago

I think I have fixed that unintended behaviour, not sure why it was there in the first place. Even tested for name not existing!? Epic misconception.

And! thank you for uncovering this bug.

fred-o commented 2 years ago

Grymt! Och tack för ett väldigt praktiskt lib :)

paed01 commented 2 years ago

Det var så lite. Kul att någon använder det.

Då stänger jag butiken för denna gång.