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
MYST-143 tequila disconnect #71
Changes from all commits
ae79a92
961651a
59aaf4e
0accb27
a02864a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,8 @@ func (manager *connectionManager) Status() ConnectionStatus { | |
} | ||
|
||
func (manager *connectionManager) Disconnect() error { | ||
manager.status = statusDisconnecting() | ||
defer func() { manager.status = statusNotConnected() }() | ||
manager.dialog.Close() | ||
return manager.vpnClient.Stop() | ||
} | ||
|
@@ -106,6 +108,10 @@ func statusNotConnected() ConnectionStatus { | |
return ConnectionStatus{NotConnected, "", nil} | ||
} | ||
|
||
func statusDisconnecting() ConnectionStatus { | ||
return ConnectionStatus{Disconnecting, "", nil} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we using empty strings and not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's go conventions. But on DTO layer I suggest to have mapping to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Json encoder can automatically handle empty strings by not rendering fields at all. It's already done by the way. |
||
} | ||
|
||
func ConfigureVpnClientFactory(mysteriumApiClient server.Client, vpnClientRuntimeDirectory string) VpnClientFactory { | ||
return func(vpnSession session.VpnSession) (openvpn.Client, error) { | ||
vpnConfig, err := openvpn.NewClientConfigFromString( | ||
|
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.
Strange to nullify sessions ID, while session still exists
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.
Does session have any meaning on disconnecting state?
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.
Probably we dont have real case