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 msg precendence when sending a merging object with msg and err #1654

Conversation

leon-volq
Copy link
Contributor

fix: #1650

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 1b6f541 into pinojs:master Feb 22, 2023
@@ -193,7 +193,7 @@ function write (_obj, msg, num) {
}
} else {
obj = _obj
if (msg === undefined && _obj[errorKey]) {
if (msg === undefined && _obj.msg === undefined && _obj[errorKey]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi all, should this be _obj[messageKey] (instead of _obj.msg) since that msg key is configurable?

Copy link
Member

Choose a reason for hiding this comment

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

@joelmukuthu I think that may be true. Can you write a test that proves it and submit a PR to fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done: #1746. I did two separate git pushes to try and trigger the failing test on CI but it didn't work as approval is needed. Hopefully you'll be able to trigger CI on the first commit!

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

Successfully merging this pull request may close these issues.

err errors are creating duplicated msg properties
4 participants