-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Inbox to back TeamChannelSource #14849
Conversation
602790a
to
9c50ded
Compare
@@ -454,6 +454,10 @@ func (idx *Indexer) allConvs(ctx context.Context, uid gregor1.UID) (map[string]t | |||
chat1.ConversationStatus_FAVORITE, | |||
chat1.ConversationStatus_MUTED, | |||
}, | |||
MemberStatus: []chat1.ConversationMemberStatus{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why bother with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RESET
is included in the default inbox query, might speed things up
|
||
// Localize the conversations | ||
res, _, err = c.G().InboxSource.Localize(ctx, uid, utils.RemoteConvs(convs), | ||
convs, _, err := c.G().InboxSource.Localize(ctx, uid, inbox.ConvsUnverified, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just call Read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted, using Read
makes things more complex since we have to convert the TlfID
to a name and would have to thread the MembersType
through for that. (just to convert back to a tlfID when we change the local query to a remote one in the Read
call). think it's simpler as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why it is the case we can't pass TLFID here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i started threading it through and i think was hitting errors here (if i'm remember correctly) https://github.com/keybase/client/blob/master/go/chat/inboxsource.go#L27
i also prefer it as is since both GetChannelsTopicName
and GetChannelsFull
can use getTLFConversations
instead of duplicating the query between Read
and ReadUnverified
(GetChannelsTopicName
can't call Localize
or we get into some unboxing cycle)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure this is fine.
97dc590
to
57b7902
Compare
57b7902
to
734d653
Compare
new test depends on https://github.com/keybase/keybase/pull/3245 |
5135140
to
551c2e8
Compare
Maybe merge master into this branch, and I'll check it out again. |
551c2e8
to
94b9c8d
Compare
merged in @mmaxim |
@@ -490,83 +489,78 @@ func (i *Inbox) applyQuery(ctx context.Context, query *chat1.GetInboxQuery, rcs | |||
queryConvIDMap[c.String()] = true | |||
} | |||
} | |||
|
|||
queryMemberStatusMap := map[chat1.ConversationMemberStatus]bool{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just make this a static thing so we aren't creating it all the time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it's built from the query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but 99% of the time it will be the same values, I was thinking we could swap in a map with the defaults values in that case instead of creating it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment inline.
b772f09
to
7b89cfb
Compare
1247caa
to
654d641
Compare
@mmaxim this is ready for final pass |
654d641
to
d821df1
Compare
Changes
CachingTeamChannelSource
to use the inbox to gather all conversations in a TLF to detect channel mentions in chat. depends on https://github.com/keybase/keybase/pull/3171 for server changes to send down all convs in the inbox. After a few client release cycles we can remove the server supporttypes.PushTeamChannels