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 patch callback #2974

Merged
merged 1 commit into from
Sep 23, 2021
Merged

fix patch callback #2974

merged 1 commit into from
Sep 23, 2021

Conversation

pgherveou
Copy link

@pgherveou pgherveou commented Sep 23, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

callback methods in the node_patches.js use false instead of null for the error parameter. This seems to trip some 3rd party packages that are comparing the first value with null and thus report false error ...

e.g https://github.com/RyanZim/universalify/blob/master/index.js#L11

What is the new behavior?

callback methods in the node_patches.js should use a null value for the error parameter

Does this PR introduce a breaking change?

  • Yes
  • No

@pgherveou
Copy link
Author

🙏 thanks for who ever review this.
Quick question is there a way to patch my project with these changes, until this land ?

@mattem
Copy link
Collaborator

mattem commented Sep 23, 2021

Huh, this seems like we lost the commits from #2837 when we rebased stable :(

Can you pull across the other changes into this diff and I'll merge?

The convention is to use `null` when calling back with no error, and
this convention is being enforced in `universalify` since
version 2.0.0.

`fs-extras` uses `universalify` to build `Promises` from the callbacks,
and the wrapper in `node_patches.js` breaks this integration.
@pgherveou
Copy link
Author

Done, copied the original commit message as well

@pgherveou
Copy link
Author

maybe we can just close this and reopen and merge the other one.
Up to you

@pgherveou
Copy link
Author

🙏 thanks for who ever review this.
Quick question is there a way to patch my project with these changes, until this land ?

answering my question
=> https://bazelbuild.github.io/rules_nodejs/changing-rules.html#patching-the-built-in-release

@alexeagle
Copy link
Collaborator

I manually cherry-picked things from stable during the 4.x branch so I must have missed one despite trying to be very careful. I'll go double-check if there's anything else missing.

thanks @pgherveou

@alexeagle alexeagle merged commit de1eaf6 into bazel-contrib:stable Sep 23, 2021
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.

3 participants