-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(redirection): adds mqtt start and stop events for redirection #573
Conversation
f718119
to
4a98f40
Compare
Codecov Report
@@ Coverage Diff @@
## main #573 +/- ##
==========================================
+ Coverage 91.23% 91.24% +0.01%
==========================================
Files 68 68
Lines 3000 3005 +5
Branches 463 463
==========================================
+ Hits 2737 2742 +5
Misses 263 263
Continue to review full report at Codecov.
|
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.
Looks good to me.
@@ -46,6 +47,7 @@ export class WsRedirect { | |||
|
|||
// We got a new web socket connection, initiate a TCP connection to the target Intel AMT host/port. | |||
logger.debug(`${messages.REDIRECT_OPENING_WEB_SOCKET} to ${params.host}: ${params.port}.`) | |||
MqttProvider.publishEvent('success', ['handleConnection'], messages.REDIRECTION_SESSION_STARTED) |
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.
Can this call fail? Is any error handling needed?
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.
If a MQTT broker is not configured/missing, the call will silently fail without impacting the rest of the code
@@ -76,6 +78,7 @@ export class WsRedirect { | |||
logger.debug(`${messages.REDIRECT_CLOSING_WEB_SOCKET} to ${params.host}: ${params.port}.`) | |||
if (this.websocketFromDevice) { | |||
this.websocketFromDevice.CloseChannel() | |||
MqttProvider.publishEvent('success', ['handleClose'], messages.REDIRECTION_SESSION_ENDED) |
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.
Can this call fail? Is any error handling needed?
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.
If a MQTT broker is not configured/missing, the call will silently fail without impacting the rest of the code
PR Checklist
What are you changing?
Adds MQTT start and stop events for redirection sessions
Anything the reviewer should know when reviewing this PR?
Hold until after 2.2 release
If the there are associated PRs in other repositories, please link them here (i.e. open-amt-cloud-toolkit/repo#365 )