Skip to content

Commit

Permalink
fix: adding a defer
Browse files Browse the repository at this point in the history
  • Loading branch information
acke committed Oct 25, 2024
1 parent 744dd54 commit a75031d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions application/server/execute_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ func Test_loginCommand_StartsAuthentication(t *testing.T) {
assert.Eventually(t, func() bool { return len(jsonRPCRecorder.Notifications()) > 0 }, 5*time.Second, 50*time.Millisecond)
notifications := jsonRPCRecorder.FindNotificationsByMethod("$/snyk.hasAuthenticated")
assert.Equal(t, 1, len(notifications))
var hasAuthencticatedNotification types.AuthenticationParams
err = notifications[0].UnmarshalParams(&hasAuthencticatedNotification)
var hasAuthenticatedNotification types.AuthenticationParams
err = notifications[0].UnmarshalParams(&hasAuthenticatedNotification)
assert.NoError(t, err)
assert.NotEmpty(t, hasAuthencticatedNotification.ApiUrl)
assert.NotEmpty(t, hasAuthenticatedNotification.ApiUrl)
}

func Test_TrustWorkspaceFolders(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/authentication/auth_service_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (a *AuthenticationServiceImpl) Authenticate(ctx context.Context) (token str
prioritizedUrl := getPrioritizedApiUrl(customUrl, engineUrl)

if prioritizedUrl != customUrl {
a.notifier.SendShowMessage(sglsp.Info, "The Snyk API Endpoint has been updated.")
defer a.notifier.SendShowMessage(sglsp.Info, "The Snyk API Endpoint has been updated.")
}

a.c.UpdateApiEndpoints(prioritizedUrl)
Expand Down

0 comments on commit a75031d

Please sign in to comment.