status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
290 stars 78 forks source link

Improve communities storage in service #9570

Closed osmaczko closed 1 year ago

osmaczko commented 1 year ago

Description

https://github.com/status-im/status-desktop/blob/165271dbeae9dea98951285cf4198b6b47f09335/src/app_service/service/community/service.nim#L150-L152

We should have one source of truth when it comes to storing communities. Now joined communities are both stored in allCommunities and joinedCommunities tables. It may easily lead to miss-synchronization and as a result in hard-to-track bugs.

One of the examples of subtle bugs is that #channel tag navigation doesn't work for spectated communities. It's because getCommunityById seeks the joinedCommunities table instead of allCommunities.

Motivated by: https://github.com/status-im/status-desktop/pull/9565#discussion_r1109439605

caybro commented 1 year ago

One of the examples of subtle bugs is that #channel tag navigation doesn't work for spectated communities. It's because getCommunityById seeks the joinedCommunities table instead of allCommunities.

That is already broken, see https://github.com/status-im/status-desktop/issues/9561

osmaczko commented 1 year ago

That is already broken, see #9561

On 0.10.0 it is only broken for spectated communities.

caybro commented 1 year ago

That is already broken, see #9561

On 0.10.0 it is only broken for spectated communities.

On master everywhere from what I can see