status-im / status-desktop

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

Communities - Reevaluation did not happen after creating a channel and then adding a permission #15175

Closed virginiabalducci closed 23 hours ago

virginiabalducci commented 1 week ago

Bug Report

Description

There are two issues reported here, if needed I can open a different issue to track issue 2. Issue 1: Re-evaluation does not happen after creating a channel and then after a few seconds of creation, adding a permission. Issue 2: When permission is added to the channel, users who do not meet the permission's condition should no longer see the channel. However, one user seems to have been kicked from the community entirely.

Steps to reproduce

Test from the control-node side to see the re-evaluation logs. (log in with a community owner)

  1. Add members to your community
  2. Create channel with permissions. For example restrict channel to anyone who holds 0,001 ETH can view and post in channel.
  3. Look for reevaluation logs.

Expected behavior

Re-evaluation to happen within 5 minutes. Members who were seeing the channel before Owner added permissions, should be restricted according to the permission. If the channel has a permission to hide it from members who don't have permissions, member should not see the channel.

Actual behavior

After 5 minutes, re-evaluation does not happen. Log in with a member, and see that members who do not met the permission's conditions see the channel and can post, but they do not see the member list. On the admin's side, all members appear on the list, even though none meet the requirements.

Owner's screen - channel just created Screenshot 2024-06-13 at 8 04 41 PM Channel's permissions added Screenshot 2024-06-13 at 8 04 54 PM Users can see the channel Screenshot 2024-06-13 at 8 11 03 PM Screenshot 2024-06-13 at 8 20 00 PM Screenshot 2024-06-13 at 8 05 03 PM

Channel was created at around 20:00 hs

geth log shows last re-evaluation happened:

➜  data  grep "reevaluation finished" geth*
geth.log:INFO [06-13|**19:40:06.374**|github.com/status-im/status-go/protocol/communities/manager.go:1454]                        reevaluation finished                    communityID=0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba elapsed=1.493571208s

Re-evaluation only happened after Owner (control node) quitted and re-opened app

➜  data  grep "reevaluation finished" geth*
geth.log:INFO [06-13|**19:40:06.374**|github.com/status-im/status-go/protocol/communities/manager.go:1454]                        reevaluation finished                   communityID=0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba elapsed=1.493571208s
geth.log:INFO [06-13|**20:19:20.388**|github.com/status-im/status-go/protocol/communities/manager.go:1454]                        reevaluation finished               communityID=0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba elapsed=1.313933875s

Owner Screenshot 2024-06-13 at 8 20 09 PM

Member Test022 who does not meet the channel requirements cannot see the channel any longer, this is as expected Screenshot 2024-06-13 at 8 20 00 PM

However, member Test023 seems to have been kicked and does not see the community any longer. Also, it does not show as a member. Screenshot 2024-06-13 at 8 28 14 PM Notice by this screen (Owner) that Test023 even posted messages Screenshot 2024-06-13 at 8 31 34 PM Screenshot 2024-06-13 at 8 32 06 PM

Adding console log from Testuser023 at the exact time that owner re-evaluation happened

DBG 2024-06-13 20:19:16.702-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=accounts_getTokenPreferences
DBG 2024-06-13 20:19:16.714-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=accounts_getCollectiblePreferences
DBG 2024-06-13 20:19:16.715-03:00 setCommunityInfo                           tid=5116307 file=status_community_link_preview.nim:155 communityId=0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba communityName="Grey Cats"
DBG 2024-06-13 20:19:16.720-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=settings_deleteExemptions
WRN 2024-06-13 20:19:16.722-03:00 trying to get chat data for an unexisting chat id topics="chat-service" tid=5116307 file=service.nim:354 chatId=
DBG 2024-06-13 20:19:16.723-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_hasUnseenActivityCenterNotifications
DBG 2024-06-13 20:19:16.723-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_activityCenterNotificationsCount
DBG 2024-06-13 20:19:16.725-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_activityCenterNotificationsCount
DBG 2024-06-13 20:19:16.726-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_hasUnseenActivityCenterNotifications
DBG 2024-06-13 20:19:16.726-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_activityCenterNotificationsCount
Warning: qrc:/app/mainui/AppMain.qml:568: TypeError: Cannot read property 'horizontalCenter' of null (qrc:/app/mainui/AppMain.qml:568, )
Warning: qrc:/app/AppLayouts/Chat/views/ChatColumnView.qml:162: TypeError: Property 'clear' of object StatusChatInput_QMLTYPE_745_QML_2020(0x60000b5da9f0, "statusChatInput") is not a function (exception occurred during delayed function evaluation) (qrc:/app/AppLayouts/Chat/views/ChatColumnView.qml:162, )
DBG 2024-06-13 20:19:16.808-03:00 Add AC notification                        topics="notifications-manager" tid=5116307 file=notifications_manager.nim:229 title="You were kicked from Grey Cats" message=
DBG 2024-06-13 20:19:16.808-03:00 Add OS notification                        topics="notifications-manager" tid=5116307 file=notifications_manager.nim:267 title="You were kicked from Grey Cats" message= identifier="{\"notificationType\":18,\"sectionId\":\"0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba\",\"isCommunitySection\":true,\"sectionActive\":false,\"chatId\":\"\",\"chatActive\":false,\"isOneToOne\":false,\"isGroupChat\":false,\"messageId\":\"\"}"
DBG 2024-06-13 20:19:21.674-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=accounts_getTokenPreferences
DBG 2024-06-13 20:19:21.690-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=accounts_getCollectiblePreferences
DBG 2024-06-13 20:19:21.690-03:00 setCommunityInfo                           tid=5116307 file=status_community_link_preview.nim:155 communityId=0x027801b8aaba3f77d3d1d85d9f76b725500d5c39b30f50d77ec12de8f27358e5ba communityName="Grey Cats"
DBG 2024-06-13 20:19:24.062-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_slowdownArchivesImport
DBG 2024-06-13 20:19:29.143-03:00 [threadpool task thread] initiating task   topics="task-threadpool" tid=5116417 file=threadpool.nim:54 messageType=AsyncLoadCuratedCommunitiesTaskArg:ObjectType threadid=5116417 task="{\"$type\":\"AsyncLoadCuratedCommunitiesTaskArg:ObjectType\",\"vptr\":105553117852544,\"slot\":\"onAsyncLoadCuratedCommunitiesDone\",\"tptr\":4301366268}"
DBG 2024-06-13 20:19:29.144-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116417 file=core.nim:27 rpc_method=wakuext_curatedCommunities
DBG 2024-06-13 20:19:30.921-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_speedupArchivesImport
DBG 2024-06-13 20:22:58.251-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=5116307 file=core.nim:27 rpc_method=wakuext_slowdownArchivesImport

After quitting and re-opening Test023 app, it seems as if they have never joined the community or they have been kicked.

Screenshot 2024-06-13 at 8 35 15 PM

Attaching geth.log from Test023 user geth.log.zip

Worth mentioning that there is an ongoing issue https://github.com/status-im/status-desktop/issues/15153 where user clicks a community link and nothing happens, I may have joined the community with this user while this issue is ongoing. Can maybe this have affected this user? Thanks!

Additional Information

jrainville commented 1 week ago

I think the second issue is related or the same as https://github.com/status-im/status-desktop/issues/15009

It might help @osmaczko have a reproduction step

osmaczko commented 1 week ago

I think the second issue is related or the same as #15009

It might help @osmaczko have a reproduction step

Thanks, I'll take a look.