Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fail immediately for a bad password on latest amqplib. #304

Merged
merged 1 commit into from Oct 24, 2022

Conversation

jwalton
Copy link
Owner

@jwalton jwalton commented Oct 24, 2022

Related to #303, it looks like now amqplib no longer has an isOperational flag on errors anymore. It looks like this was a BlueBird thing, and amqplib switch to native promises so it was removed.

We used to fail immediately with a reject when trying to connect with a bad password, but because of the missing isOperational flag we don't anymore. I fix this, and verified it on amqplib v0.8.0, then bumped the development version of amqplib to v0.10.3.

@jwalton jwalton requested a review from luddd3 October 24, 2022 14:58
Copy link
Collaborator

@luddd3 luddd3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should reject in more scenarios than 403? But it definitely works for now =)

@jwalton
Copy link
Owner Author

jwalton commented Oct 24, 2022

I have the same concern. :) Or maybe we should reject nothing and just keep generating connection failed events?

@jwalton jwalton merged commit 0d5dbeb into master Oct 24, 2022
@jwalton jwalton deleted the fix-bad-passwords branch October 24, 2022 19:28
@jwalton
Copy link
Owner Author

jwalton commented Oct 24, 2022

🎉 This PR is included in version 4.1.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

@luddd3
Copy link
Collaborator

luddd3 commented Oct 24, 2022

I think that we maybe should reject all 4xx errors since all reconnect attempts will fail every time. Without the reject, the error is silently ignored and the caller will not be informed of the wrong parameters, e.g wrong credentials.

@jwalton
Copy link
Owner Author

jwalton commented Oct 24, 2022 via email

@luddd3
Copy link
Collaborator

luddd3 commented Oct 25, 2022

I think that is what we would have to do, unless amqplib is fixed so we get the error code as a property on the error.

I saw an old issue at amqplib where they did something similar (but a regexp is better)
amqp-node/amqplib#266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants