From b4be281671ecfe5c1e6f831614ca1dde48522cd7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 25 Oct 2022 11:44:04 +0200 Subject: Client + FSM: Remove background argument from transition This fixes a race condition reported by Go's -race flag In the future we should use waitgroups to ensure the OAuth local listener is started before we sent the URL --- client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/client.go') diff --git a/client/client.go b/client/client.go index 5377801..0f9f536 100644 --- a/client/client.go +++ b/client/client.go @@ -119,7 +119,7 @@ func (client *Client) Register( } // Go to the No Server state with the saved servers after we're done - defer client.FSM.GoTransitionWithData(STATE_NO_SERVER, client.Servers, true) + defer client.FSM.GoTransitionWithData(STATE_NO_SERVER, client.Servers) // Let's Connect! doesn't care about discovery if client.isLetsConnect() { @@ -160,7 +160,7 @@ func (client *Client) askProfile(chosenServer server.Server) error { if profilesErr != nil { return types.NewWrappedError("failed asking for profiles", profilesErr) } - client.FSM.GoTransitionWithData(STATE_ASK_PROFILE, profiles, false) + client.FSM.GoTransitionWithData(STATE_ASK_PROFILE, profiles) return nil } -- cgit v1.2.3