-
Notifications
You must be signed in to change notification settings - Fork 226
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(azure-iot-device-amqp): 🐛 multiple AMQP links were being created for telemetry #966
fix(azure-iot-device-amqp): 🐛 multiple AMQP links were being created for telemetry #966
Conversation
/azp run node-canary |
Azure Pipelines successfully started running 1 pipeline(s). |
debug('using existing d2c link'); | ||
this._d2cLink.send(amqpMessage, handleResult('AMQP Transport: Could not send', sendCallback)); | ||
} else { | ||
debug('waiting for a D2C link'); |
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.
Tell the story here in a comment.
} | ||
}); | ||
} else { | ||
if (this._d2cLink) { |
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.
You're going to have to add unit tests simply to keep our coverage numbers up AND, this should have some tests anyway.
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.
Touch base with me on if you are having an issue creating unit tests.
/azp run node-canary |
Azure Pipelines successfully started running 1 pipeline(s). |
device/transport/amqp/src/amqp.ts
Outdated
if (this._c2dLink) { | ||
debug('C2D link already attached, doing nothing....'); | ||
process.nextTick(callback); | ||
} else if (this._c2dLinkAttaching) { |
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.
I think you face an issue that in the time betwwen starting to attach the c2d link and it's completion
- you get a new enable.
- you go ahead and on the next tick invoke the callback for the second enable which gives the implication that c2d is enabled when it's not.
- the actual enable then finishes 20 ticks later
Honestly, I think your solution to the send problem was pretty darn good. Can you use it here? If you can, you would then be for the most part be repeating code. Time to put enabling code into a function at that point? Darn booleans. Can't trust them.
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.
I see it. Good catch.
Looks good. We'll have to fix the gate though |
… explanation in comments
/azp run horton-node-gate |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run horton-node-gate |
Azure Pipelines successfully started running 1 pipeline(s). |
close #965
close #957