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

Merged
merged 11 commits into from Jan 10, 2019

Conversation

Projects
None yet
2 participants
@joshblum
Copy link
Member

joshblum commented Nov 27, 2018

Changes CachingTeamChannelSource to use the inbox to gather all conversations in a TLF to detect channel mentions in chat. depends on keybase/keybase#3171 for server changes to send down all convs in the inbox. After a few client release cycles we can remove the server support types.PushTeamChannels

@joshblum joshblum requested a review from mmaxim Nov 27, 2018

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch from 602790a to 9c50ded Nov 29, 2018

@@ -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{

This comment has been minimized.

@mmaxim

mmaxim Dec 4, 2018

Member

Why bother with this?

This comment has been minimized.

@joshblum

joshblum Dec 4, 2018

Member

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,

This comment has been minimized.

@mmaxim

mmaxim Dec 4, 2018

Member

Can just call Read

This comment has been minimized.

@joshblum

joshblum Dec 4, 2018

Member

fixed

This comment has been minimized.

@joshblum

joshblum Dec 4, 2018

Member

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

This comment has been minimized.

@mmaxim

mmaxim Dec 18, 2018

Member

I wonder why it is the case we can't pass TLFID here...

This comment has been minimized.

@joshblum

joshblum Dec 18, 2018

Member

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)

This comment has been minimized.

@mmaxim

mmaxim Dec 18, 2018

Member

Sure this is fine.

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch 4 times, most recently from 97dc590 to 57b7902 Dec 4, 2018

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch from 57b7902 to 734d653 Dec 12, 2018

@joshblum

This comment has been minimized.

Copy link
Member

joshblum commented Dec 12, 2018

new test depends on keybase/keybase#3245

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch 2 times, most recently from 5135140 to 551c2e8 Dec 14, 2018

@mmaxim

This comment has been minimized.

Copy link
Member

mmaxim commented Dec 18, 2018

Maybe merge master into this branch, and I'll check it out again.

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch from 551c2e8 to 94b9c8d Dec 18, 2018

@joshblum

This comment has been minimized.

Copy link
Member

joshblum commented Dec 18, 2018

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{}

This comment has been minimized.

@mmaxim

mmaxim Dec 18, 2018

Member

Can we just make this a static thing so we aren't creating it all the time?

This comment has been minimized.

@joshblum

joshblum Dec 18, 2018

Member

but it's built from the query

This comment has been minimized.

@mmaxim

mmaxim Dec 18, 2018

Member

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.

This comment has been minimized.

@joshblum
@mmaxim
Copy link
Member

mmaxim left a comment

One comment inline.

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch 3 times, most recently from b772f09 to 7b89cfb Dec 18, 2018

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch 5 times, most recently from 1247caa to 654d641 Jan 7, 2019

@joshblum

This comment has been minimized.

Copy link
Member

joshblum commented Jan 9, 2019

@mmaxim this is ready for final pass

@mmaxim

mmaxim approved these changes Jan 9, 2019

@joshblum joshblum force-pushed the joshblum/chanfix-CORE-9428 branch from 654d641 to d821df1 Jan 9, 2019

@joshblum joshblum merged commit 5f1a984 into master Jan 10, 2019

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/jenkins/pr-head This commit looks good
Details

@joshblum joshblum deleted the joshblum/chanfix-CORE-9428 branch Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment