Skip to content

Commit 0ace8cc

Browse files
authored
fix outbox badging (keybase#20867)
* fix outbox badging * Revert "fix outbox badging" This reverts commit c473371. * default to topic type CHAT in PostLocalNonblock
1 parent 2a9e9d3 commit 0ace8cc

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎go/chat/inboxsource.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,8 @@ func (s *HybridInboxSource) ApplyLocalChatState(ctx context.Context, infos []key
773773
localUpdates := make(map[string]chat1.LocalMtimeUpdate)
774774
s.Debug(ctx, "ApplyLocalChatState: looking through %d outbox items for badgable errors", len(obrs))
775775
for _, obr := range obrs {
776-
if !(obr.Msg.IsBadgableType() && obr.Msg.ClientHeader.Conv.TopicType == chat1.TopicType_CHAT) {
776+
if topicType := obr.Msg.ClientHeader.Conv.TopicType; !(obr.Msg.IsBadgableType() && topicType == chat1.TopicType_CHAT) {
777+
s.Debug(ctx, "ApplyLocalChatState: skipping msgTyp: %v, topicType: %v", obr.Msg.MessageType(), topicType)
777778
continue
778779
}
779780
state, err := obr.State.State()

‎go/chat/server.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,9 @@ func (h *Server) PostLocalNonblock(ctx context.Context, arg chat1.PostLocalNonbl
991991
sender := NewBlockingSender(h.G(), h.boxer, h.remoteClient)
992992
nonblockSender := NewNonblockingSender(h.G(), sender)
993993
prepareOpts.ReplyTo = arg.ReplyTo
994+
if arg.Msg.ClientHeader.Conv.TopicType == chat1.TopicType_NONE {
995+
arg.Msg.ClientHeader.Conv.TopicType = chat1.TopicType_CHAT
996+
}
994997
obid, _, err := nonblockSender.Send(ctx, arg.ConversationID, arg.Msg, arg.ClientPrev, arg.OutboxID,
995998
nil, &prepareOpts)
996999
if err != nil {

‎go/kbfs/libkbfs/chat_rpc.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ func (c *ChatRPC) SendTextMessage(
280280
ConversationID: convID,
281281
Msg: chat1.MessagePlaintext{
282282
ClientHeader: chat1.MessageClientHeader{
283+
Conv: chat1.ConversationIDTriple{
284+
TopicType: chat1.TopicType_KBFSFILEEDIT,
285+
},
283286
TlfName: string(tlfName),
284287
TlfPublic: tlfType == tlf.Public,
285288
MessageType: chat1.MessageType_TEXT,
@@ -338,6 +341,9 @@ func (c *ChatRPC) SendTextMessage(
338341
ConversationID: selfConvID,
339342
Msg: chat1.MessagePlaintext{
340343
ClientHeader: chat1.MessageClientHeader{
344+
Conv: chat1.ConversationIDTriple{
345+
TopicType: chat1.TopicType_KBFSFILEEDIT,
346+
},
341347
TlfName: string(session.Name),
342348
TlfPublic: false,
343349
MessageType: chat1.MessageType_TEXT,

0 commit comments

Comments
 (0)