status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.88k stars 984 forks source link

Channel permissions are not updated on mobile side until community re-opening #17990

Open pavloburykh opened 10 months ago

pavloburykh commented 10 months ago

Originally reported here by @felicio

This issue describes an edge case when community channel permissions have been updated by admin at the moment when mobile community member is located at the community/channel screen. In this case permissions will be updated in mobile UI only after re-opening the community screen.

Preconditions: User A - desktop admin of the community with token gated channels. User B - mobile user, member of the community.

Steps:

  1. User B opens community home screen or token gated channel screen
  2. While User B remains on the screen User A changes channel permissions so that User B no longer meets community requirements.
  3. See if User B can still enter token gated channels

Actual result: User B is able to enter token gated channels until he re-opens the community home screen. User B is not able to post messages in channel and observes "You are not a member of this group" message.

https://github.com/status-im/status-mobile/assets/5999878/07562ce3-e9f4-47c8-8f15-d8717140fbcb

Expected result:

  1. We should update mobile UI without need to re-enter community home page.
  2. I am not sure about the case when User B is located inside channel when permissions are updated: may be we should redirect user to community home screen at this moment. But showing "You are not a member of this group" message does not seem to be correct. Maybe we need some input from design team on this edgecase.

Additional Information

jo-mut commented 7 months ago

Some of my finding while investigating this

  1. Changing permission does not seem to have any UI effect. While the lock and unlocked icon is applied on ios when you tinker with the permissions, on android this icon is not showing at all
  2. When the user is already inside the an open channel (i.e can view conversations) and the permissions are updated such that the user does not meet the requirements, the composer is hidden from the user and the message You are not a member of this group is displayed. Once the user navigates back to the community page in this case, the user is no longer able to open the channel
  3. View only and View and Post have the same effect on the UI. They both changed the icon to lock/unlocked when enabled/disabled and they both prevent access to the channel such that the user cannot view the conversations. Given that these are two different options in the UI i assume the functionality should also have a difference

In conclusion, from my investigations:

More of a questions: the rule View only am not sure if this should actually work as currently seems to work. It is my thinking the a View only channel behaves like an open channel with the difference being that the user should not be able to post a message because he is not a member

jo-mut commented 7 months ago

if the user is on the conversations page and the rule is deleted then the channel becomes open again and the user can view and post messages but on navigating back to the community page all channels are still token-gated until until i relaunch the app. This is more consistent with the reported issue

jo-mut commented 7 months ago

@pavloburykh I assume deleting a rule should not disable permissions. Regarding my comments above on the View only permission. After further investigations it works okay. I was a little confused because I set the rule but had zero SNT but upon using a loaded wallet the results were the expected

I was not able to reproduce the bug in this issue after several days of testing it. All seems okay