From 6855da0caca311d2360401aff334724c063a2e45 Mon Sep 17 00:00:00 2001
From: joshemb <josh@elixxir.io>
Date: Wed, 20 Jul 2022 10:58:36 -0700
Subject: [PATCH] Revert fix for already established connection

---
 auth/request.go    |  4 ++--
 connect/connect.go | 11 -----------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/auth/request.go b/auth/request.go
index 8fd4aaac2..d37385815 100644
--- a/auth/request.go
+++ b/auth/request.go
@@ -31,11 +31,11 @@ import (
 
 const terminator = ";"
 
+// Error constant strings. Any changes to these should go over usages of the
+// affected messages in other applications (if applicable)
 const (
 	// ErrChannelExists is a message returned in state.Request when an
 	// authenticated channel exists between the partner and me.
-	// Note that modifications to this should go over usages of this message
-	// in other packages (if applicable).
 	ErrChannelExists = "Authenticated channel already established with partner"
 )
 
diff --git a/connect/connect.go b/connect/connect.go
index f2cd63c90..f6aace42d 100644
--- a/connect/connect.go
+++ b/connect/connect.go
@@ -8,7 +8,6 @@ package connect
 
 import (
 	"io"
-	"strings"
 	"sync/atomic"
 	"time"
 
@@ -96,16 +95,6 @@ func Connect(recipient contact.Contact, messenger *xxdk.E2e,
 	// Perform the auth request
 	_, err := messenger.GetAuth().Request(recipient, nil)
 	if err != nil {
-		// Return connection if a partnership already exists
-		if strings.Contains(err.Error(), auth.ErrChannelExists) {
-			newPartner, err := messenger.GetE2E().GetPartner(recipient.ID)
-			if err != nil {
-				return nil, err
-			}
-			conn := BuildConnection(newPartner,
-				messenger.GetE2E(), messenger.GetAuth(), p)
-			return conn, nil
-		}
 		return nil, err
 	}
 
-- 
GitLab