From 8a7916d959e8bebe1751174a3b983f8d55391620 Mon Sep 17 00:00:00 2001
From: benjamin <ben@elixxir.io>
Date: Wed, 5 Oct 2022 16:31:20 -0700
Subject: [PATCH] removed broken guard code in reception functions

---
 indexedDb/implementation.go | 39 -------------------------------------
 1 file changed, 39 deletions(-)

diff --git a/indexedDb/implementation.go b/indexedDb/implementation.go
index 14c3d851..aba24927 100644
--- a/indexedDb/implementation.go
+++ b/indexedDb/implementation.go
@@ -157,23 +157,6 @@ func (w *wasmModel) ReceiveMessage(channelID *id.ID,
 	msgToInsert := buildMessage(channelID.Marshal(), messageID.Bytes(), nil,
 		nickname, text, identity, timestamp, lease, round.ID, mType, status)
 
-	// Attempt a lookup on the MessageID if it is non-zero to find an existing
-	// entry for it. This occurs any time a sender receives their own message
-	// from the mixnet.
-	emptyID := cryptoChannel.MessageID{}
-	jww.DEBUG.Printf("messageID: %s, blank messageID: %s",
-		messageID.String(),
-		emptyID)
-	if !messageID.Equals(cryptoChannel.MessageID{}) {
-		jww.DEBUG.Printf("non-empty messageID detected")
-		uuid, err := w.msgIDLookup(messageID)
-		if err == nil && uuid != 0 {
-			jww.WARN.Printf("found MessageID, will upsert: %d",
-				uuid)
-			msgToInsert.ID = uuid
-		}
-	}
-
 	uuid, err := w.receiveHelper(msgToInsert)
 	if err != nil {
 		jww.ERROR.Printf("Failed to receiver message: %+v", err)
@@ -199,17 +182,6 @@ func (w *wasmModel) ReceiveReply(channelID *id.ID,
 		replyTo.Bytes(), nickname, text, identity, timestamp, lease, round.ID,
 		mType, status)
 
-	// Attempt a lookup on the MessageID if it is non-zero to find an existing
-	// entry for it. This occurs any time a sender receives their own message
-	// from the mixnet.
-	if !messageID.Equals(cryptoChannel.MessageID{}) {
-		uuid, err := w.msgIDLookup(messageID)
-		if err != nil {
-			// message is already in the database, no insert necessary
-			return uuid
-		}
-	}
-
 	uuid, err := w.receiveHelper(msgToInsert)
 
 	if err != nil {
@@ -235,17 +207,6 @@ func (w *wasmModel) ReceiveReaction(channelID *id.ID,
 		reactionTo.Bytes(), nickname, reaction, identity, timestamp, lease,
 		round.ID, mType, status)
 
-	// Attempt a lookup on the MessageID if it is non-zero to find
-	// an existing entry for it. This occurs any time a sender
-	// receives their own message from the mixnet.
-	if !messageID.Equals(cryptoChannel.MessageID{}) {
-		uuid, err := w.msgIDLookup(messageID)
-		if err == nil {
-			// message is already in the database, no insert necessary
-			return uuid
-		}
-	}
-
 	uuid, err := w.receiveHelper(msgToInsert)
 	if err != nil {
 		jww.ERROR.Printf("Failed to receive reaction: %+v", err)
-- 
GitLab