Replace argue.js usage with inline argument checking#162
Merged
Conversation
|
thanks for the fix @murgatroid99 ! |
This was referenced Feb 10, 2018
| options = {}; | ||
| } | ||
| if (!((metadata instanceof Metadata) && | ||
| (options instanceof Object) && |
There was a problem hiding this comment.
This causes requests to throw when options === undefined. If this is new, intended behavior it is a breaking change from argue.js's behavior. This caused quite the headache for me and my team, as we didn't think to look to the grpc lib originally, because we felt such a breaking change would not be in a minor version bump.
For reference, we were calling the client request as such:
function makeCall(rpc, message, meta, options) {
return new Bluebird((resolve, reject) => {
client[rpc](message, meta, options, (err, res) => {
if (err) {
return reject(err);
}
return resolve(res);
});
});
}
Giving the options argument a default of = {} resolved the issue, but I don't feel like this should be necessary.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #133 and #161. The error messages will be a little less helpful right now, but we can improve that later and I think it's good to get the fix out now.
The dependency on argue.js was actually removed a while ago in grpc/grpc#11707, but for some reason that change never made it out of the v1.4.x branch. So this is also correcting that error.