-
Notifications
You must be signed in to change notification settings - Fork 2
Handle disconnect when channel is not initialized #23
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
Conversation
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.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| OSS Licenses | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
9b472c2 to
edba61d
Compare
|
@guisehn would this work to close the issue? Any idea on how to properly test this 😭 |
8902d04 to
e89eb5d
Compare
| if state.channel do | ||
| state.on_disconnect.() | ||
| state.channel.adapter.disconnect(state.channel) | ||
|
|
||
| :telemetry.execute( | ||
| [:conn_grpc, :channel, :disconnected], | ||
| %{duration: now - state.connection_start}, | ||
| telemetry_metadata(state) | ||
| ) | ||
| end |
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 am not sure if I am correct here to check for nil and trigger the telemetry when it actually happens.
While also, if that is the case that I need to check nil should I still call state.on_disconnect.() regardless of nil channel or not?
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 it's fine not to do anything when channel is nil.
e89eb5d to
da37032
Compare
fixes TheRealReal#22 Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
da37032 to
e118e4b
Compare
guisehn
left a comment
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.
Thanks for the contribution! 😄
Signed-off-by: Yordis Prieto yordis.prieto@gmail.com