From 113a6b617a5ee6c5fcc6c2d8714e1091e3adc0b1 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Fri, 17 Dec 2021 14:46:24 -0500 Subject: [PATCH] add back passwrod errors for use; staticcheck fixes --- event/common.go | 6 ++++++ protocol/connections/engine.go | 3 +-- testing/cwtch_peer_server_integration_test.go | 16 ---------------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/event/common.go b/event/common.go index e8a51b0..1fe4ad5 100644 --- a/event/common.go +++ b/event/common.go @@ -122,6 +122,12 @@ const ( // Password, NewPassword ChangePassword = Type("ChangePassword") + // Error(err), EventID + ChangePasswordError = Type("ChangePasswordError") + + // EventID + ChangePasswordSuccess = Type("ChangePasswordSuccess") + // a group has been successfully added or newly created // attributes: // Data [serialized *model.Group] diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index b8d9885..8e66e68 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -622,9 +622,8 @@ func (e *engine) handlePeerRetVal(hostname string, getValData, retValData []byte // REQUIREMENTS: must be called inside a block with e.ephemeralServicesLock.Lock() // can't do it iself because is called from inside peerWithTokenServer which holds the lock func (e *engine) leaveServer(server string) { - es, ok := e.ephemeralServices[server] + ephemeralService, ok := e.ephemeralServices[server] if ok { - ephemeralService := es.(tapir.Service) ephemeralService.Shutdown() delete(e.ephemeralServices, server) } diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 7d0a525..5b41bd0 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -274,12 +274,6 @@ func TestCwtchPeerIntegration(t *testing.T) { numGoRoutinesPostCarolConnect := runtime.NumGoroutine() - messages, err := alice.GetMostRecentMessages(aliceGroupConversationID, 0, 0, 20) - log.Infof("Alice messages") - for i, msg := range messages { - log.Infof("alice message %v: %v", i, msg) - } - // Check Alice Timeline checkMessage(t, alice, aliceGroupConversationID, 1, aliceLines[0]) checkMessage(t, alice, aliceGroupConversationID, 2, bobLines[0]) @@ -295,11 +289,6 @@ func TestCwtchPeerIntegration(t *testing.T) { checkSendMessageToGroup(t, bob, bobGroupConversationID, bobLines[2]) time.Sleep(time.Second * 30) - messages, err = bob.GetMostRecentMessages(aliceGroupConversationID, 0, 0, 20) - log.Infof("Bob messages") - for i, msg := range messages { - log.Infof("bob message %v: %v", i, msg) - } // Check Bob Timeline checkMessage(t, bob, bobGroupConversationID, 1, aliceLines[0]) checkMessage(t, bob, bobGroupConversationID, 2, bobLines[0]) @@ -309,11 +298,6 @@ func TestCwtchPeerIntegration(t *testing.T) { checkMessage(t, bob, bobGroupConversationID, 6, bobLines[2]) // Check Carol Timeline - messages, err = carol.GetMostRecentMessages(aliceGroupConversationID, 0, 0, 20) - log.Infof("Carol messages") - for i, msg := range messages { - log.Infof("carol message %v: %v", i, msg) - } checkMessage(t, carol, carolGroupConversationID, 1, aliceLines[0]) checkMessage(t, carol, carolGroupConversationID, 2, bobLines[0]) checkMessage(t, carol, carolGroupConversationID, 3, aliceLines[1])