-
Notifications
You must be signed in to change notification settings - Fork 842
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(grpc): patch loadPackageDefinition #400
fix(grpc): patch loadPackageDefinition #400
Conversation
) { | ||
const result = original.apply(this, arguments as never); | ||
// Copied from exports.loadPackageDefintion(...) | ||
for (const serviceFqn in packageDef) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to create a private function to do the code inside this for
loop? That could help simplify the overall _patchLoadPackageDefinition
function
|
||
shimmer.massWrap( | ||
serviceClient.prototype, | ||
methodList as never[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: what's the role of the cast to never
here?
); | ||
endSpan(); | ||
// if an error was emitted, the span will be ended there | ||
if (status.code === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test for this?
Closing this since the change in patching is unnecessary if example is used outside of lerna #327 |
Which problem is this PR solving?
Short description of the changes
The internal files loader is not correctly patching the internal generic catch all
client.makeClientConstructor
, so the 2 main ways of creating clients are patched instead.loadObject
is not patched. I've disabled the generic patch until #285 solves the internal patches not propagating to the module's usage of them.