-
Notifications
You must be signed in to change notification settings - Fork 56
Fix reconnect logic #447
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 reconnect logic #447
Conversation
cheukt
commented
Sep 27, 2023
- sessions client was overwriting dial options in the robot client, so making an actual copy
- on reconnect, sessions client actually wants the new socket address, so got that instead of the address of the robot itself
src/viam/sessions_client.py
Outdated
if dial_options is not None: | ||
self._dial_options = DialOptions( | ||
disable_webrtc=True, | ||
auth_entity=dial_options.auth_entity, | ||
credentials=dial_options.credentials, | ||
insecure=dial_options.insecure, | ||
allow_insecure_downgrade=dial_options.allow_insecure_downgrade, | ||
allow_insecure_with_creds_downgrade=dial_options.allow_insecure_with_creds_downgrade, | ||
) |
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.
Let's use deepcopy here (from copy import deepcopy
), otherwise we'll need to remember to add new dial option fields here too.
if dial_options is not None: | |
self._dial_options = DialOptions( | |
disable_webrtc=True, | |
auth_entity=dial_options.auth_entity, | |
credentials=dial_options.credentials, | |
insecure=dial_options.insecure, | |
allow_insecure_downgrade=dial_options.allow_insecure_downgrade, | |
allow_insecure_with_creds_downgrade=dial_options.allow_insecure_with_creds_downgrade, | |
) | |
if dial_options is not None: | |
self._dial_options = deepcopy(dial_options) |
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.
done
self._dial_options = DialOptions(disable_webrtc=True) | ||
|
||
self._dial_options = deepcopy(dial_options) if dial_options is not None else DialOptions() | ||
self._dial_options.disable_webrtc = True |
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.
ah nice, yeah i forgot we always want webrtc disabled here - good catch