From f6b63148728504230926a71f28e35155be524102 Mon Sep 17 00:00:00 2001
From: Benjamin Wenger <ben@elixxir.ioo>
Date: Mon, 24 Oct 2022 16:26:35 -0700
Subject: [PATCH] minor fixes

---
 channels/eventModel.go | 21 ++++++++++++---------
 channels/manager.go    |  3 ++-
 cmix/follow.go         |  7 ++++---
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/channels/eventModel.go b/channels/eventModel.go
index cab0ef936..153a6bd68 100644
--- a/channels/eventModel.go
+++ b/channels/eventModel.go
@@ -299,9 +299,10 @@ func (e *events) receiveTextMessage(channelID *id.ID,
 			var replyTo cryptoChannel.MessageID
 			copy(replyTo[:], txt.ReplyMessageID)
 			tag := makeChaDebugTag(channelID, pubKey, content, SendReplyTag)
-			jww.INFO.Printf("[%s]UserListener - Received reply from %s "+
-				"to %s", tag, base64.StdEncoding.EncodeToString(pubKey),
-				base64.StdEncoding.EncodeToString(txt.ReplyMessageID))
+			jww.INFO.Printf("[%s]Channels - Received reply from %s "+
+				"to %s on %s", tag, base64.StdEncoding.EncodeToString(pubKey),
+				base64.StdEncoding.EncodeToString(txt.ReplyMessageID),
+				channelID)
 			return e.model.ReceiveReply(channelID, messageID, replyTo,
 				nickname, txt.Text, pubKey, codeset, timestamp, lease, round, Text, status)
 
@@ -317,9 +318,10 @@ func (e *events) receiveTextMessage(channelID *id.ID,
 	}
 
 	tag := makeChaDebugTag(channelID, pubKey, content, SendMessageTag)
-	jww.INFO.Printf("[%s]UserListener - Received message from %s "+
-		"to %s", tag, base64.StdEncoding.EncodeToString(pubKey),
-		base64.StdEncoding.EncodeToString(txt.ReplyMessageID))
+	jww.INFO.Printf("[%s]Channels - Received message from %s "+
+		"to %s on %s", tag, base64.StdEncoding.EncodeToString(pubKey),
+		base64.StdEncoding.EncodeToString(txt.ReplyMessageID),
+		channelID)
 
 	return e.model.ReceiveMessage(channelID, messageID, nickname, txt.Text, pubKey, codeset,
 		timestamp, lease, round, Text, status)
@@ -361,9 +363,10 @@ func (e *events) receiveReaction(channelID *id.ID,
 		copy(reactTo[:], react.ReactionMessageID)
 
 		tag := makeChaDebugTag(channelID, pubKey, content, SendReactionTag)
-		jww.INFO.Printf("[%s]UserListener - Received reaction from %s "+
-			"to %s", tag, base64.StdEncoding.EncodeToString(pubKey),
-			base64.StdEncoding.EncodeToString(react.ReactionMessageID))
+		jww.INFO.Printf("[%s]Channels - Received reaction from %s "+
+			"to %s on %s", tag, base64.StdEncoding.EncodeToString(pubKey),
+			base64.StdEncoding.EncodeToString(react.ReactionMessageID),
+			channelID)
 
 		return e.model.ReceiveReaction(channelID, messageID, reactTo, nickname,
 			react.Reaction, pubKey, codeset, timestamp, lease, round, Reaction, status)
diff --git a/channels/manager.go b/channels/manager.go
index 02ee3d44b..b6a474e2f 100644
--- a/channels/manager.go
+++ b/channels/manager.go
@@ -187,6 +187,7 @@ func (m *manager) LeaveChannel(channelID *id.ID) error {
 // GetChannels returns the IDs of all channels that have been joined. Use
 // getChannelsUnsafe if you already have taken the mux.
 func (m *manager) GetChannels() []*id.ID {
+	jww.INFO.Printf("GetChannels")
 	m.mux.Lock()
 	defer m.mux.Unlock()
 	return m.getChannelsUnsafe()
@@ -194,7 +195,7 @@ func (m *manager) GetChannels() []*id.ID {
 
 // GetChannel returns the underlying cryptographic structure for a given channel.
 func (m *manager) GetChannel(chID *id.ID) (*cryptoBroadcast.Channel, error) {
-	jww.INFO.Printf("GetChannel %s", chID)
+	jww.INFO.Printf("GetChannel(%s)", chID)
 	jc, err := m.getChannel(chID)
 	if err != nil {
 		return nil, err
diff --git a/cmix/follow.go b/cmix/follow.go
index 8e4dd0308..051438d4f 100644
--- a/cmix/follow.go
+++ b/cmix/follow.go
@@ -115,7 +115,10 @@ func (c *client) followNetwork(report ClientErrorReport,
 				return nil
 			}
 
-			// get the list of identities to track
+			//denote the execution
+			atomic.AddUint64(c.tracker, 1)
+
+			// track the message on every identity
 			stream := c.rng.GetStream()
 			err := c.Tracker.ForEach(
 				int(c.param.MaxParallelIdentityTracks),
@@ -174,8 +177,6 @@ func (c *client) follow(identity receptionID.IdentityUse,
 		identity.ER = fakeEr
 	}
 
-	atomic.AddUint64(c.tracker, 1)
-
 	// Get client version for poll
 	version := c.session.GetClientVersion()
 
-- 
GitLab