Skip to content
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

Align CommunityChats and Chats #14219

Closed
jrainville opened this issue Mar 28, 2024 · 1 comment
Closed

Align CommunityChats and Chats #14219

jrainville opened this issue Mar 28, 2024 · 1 comment

Comments

@jrainville
Copy link
Member

Description

Follow up from #12595

Problem explained here: #14202 (comment)

The issue this refactor is trying to address is that from status-go, we have two types of Chats.

  1. The protocol.Chat object is the basic Chat object we use mostly. it comes from the AllChats store and it is stored in our chatService's cache.

  2. The CommunityChat object is only used in Communities and comes as part of the Community description in the chats property.

The difference between the two is that CommunityChat contains less properties than protocol.Chat, but, it also contains Community exclusive properties like canPostReactions and the community chat members, since the basic Chat only contains members for group chats.

The problem in Desktop is that both those types of Chats are then converted into ChatDto, so when you're using Chats in the Desktop code, you can easily get confused and think you will have all the properties.

So the goal of the refactor is to align those two.

This is either by fixing the issue in status-go so that the AllChats store contains all the CommunityChat properties as well, so that we could just rely on our chatService cache.

This has the downside of maybe increase the load time on app start and the cache will be heavier on the status-go side. So we need to confirm with mobile if it's possible.

The other option is to make the chat service smarter and aggregate the CommunitChat data into its cache so that it stays up to date on the cCommunityChat data at all times, that way we only use that cache.

The downside of this second option is that it's more finicky and it also means mobile will run into the same problem

Let me know what you think and if you have other options.

@jrainville jrainville added this to the 2.30.0 Beta milestone Mar 28, 2024
@jrainville jrainville removed this from the 2.30.0 Beta milestone May 15, 2024
jrainville added a commit that referenced this issue May 23, 2024
Part of #14886

The problem was that the ChatDto doesn't have a categoryID, so we need to use the CommunityChat.

I think before, the channel groups had the full chat info, but not we can't rely on that.

The CommunityChat/Chat alignment refactor will simplify all of that #14219
jrainville added a commit that referenced this issue May 24, 2024
Part of #14886

The problem was that the ChatDto doesn't have a categoryID, so we need to use the CommunityChat.

I think before, the channel groups had the full chat info, but not we can't rely on that.

The CommunityChat/Chat alignment refactor will simplify all of that #14219
jrainville added a commit that referenced this issue May 24, 2024
Part of #14886

The problem was that the ChatDto doesn't have a categoryID, so we need to use the CommunityChat.

I think before, the channel groups had the full chat info, but not we can't rely on that.

The CommunityChat/Chat alignment refactor will simplify all of that #14219
jrainville added a commit that referenced this issue May 27, 2024
Part of #14886

The problem was that the ChatDto doesn't have a categoryID, so we need to use the CommunityChat.

I think before, the channel groups had the full chat info, but not we can't rely on that.

The CommunityChat/Chat alignment refactor will simplify all of that #14219
@jrainville
Copy link
Member Author

Closing as #11694 is the smarter avenue to tackle this issue

@jrainville jrainville closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

1 participant