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

fix(joinCommunity): Fixing permissions checks in join community flows #14215

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexjba
Copy link
Contributor

@alexjba alexjba commented Mar 28, 2024

What does the PR do

Closing: #14095
Closing: #14200
Closing: #12326

Moving the permissions model from communities module to chat section module (at least that's the main intention). But we'll need to also move or adapt other dependencies like check permissions on selected addresses, revealed addresses.

Motivation: The current implementation in communities module is built based on the assumption that we'll need the permissions for only one community at a time. But it's not the case. We have lots of qml bindings on the permission model, each one requesting the model for a new community because the permissionsModel access is done something like:

    readonly property var permissionsModel: {
        root.store.prepareTokenModelForCommunity(communityData.id)
        return root.store.permissionsModel
    }

O top of this, there are issues with permission update events handling and we're not always seeing the permission updates in qml.

Affected areas

@alexjba
Copy link
Contributor Author

alexjba commented Mar 28, 2024

@jrainville I'd really appreciate your thoughts here.
It's still very much WIP, but I need to confirm the direction with you because this change is snowballing and I don't want to waste time if I'm missing some crucial detail and we shouldn't move this implementation in the chat section. I can't really find the reason why it was implemented in the communities module and this is why I'm not 100% sure the direction is good.

@status-im-auto
Copy link
Member

status-im-auto commented Mar 28, 2024

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d89a193 #1 2024-03-28 13:49:43 ~6 min tests/nim 📄log
✔️ d89a193 #1 2024-03-28 13:50:01 ~7 min macos/aarch64 🍎dmg
✔️ d89a193 #1 2024-03-28 13:54:36 ~11 min tests/ui 📄log
✔️ d89a193 #1 2024-03-28 13:54:46 ~11 min macos/x86_64 🍎dmg
✔️ d89a193 #1 2024-03-28 13:59:41 ~16 min linux/x86_64 📦tgz
✔️ d89a193 #1 2024-03-28 14:08:09 ~25 min windows/x86_64 💿exe
✔️ 4b8d34e #2 2024-03-28 16:40:07 ~5 min macos/aarch64 🍎dmg
✔️ 4b8d34e #2 2024-03-28 16:42:25 ~7 min tests/nim 📄log
✔️ 4b8d34e #2 2024-03-28 16:42:58 ~8 min macos/x86_64 🍎dmg
✔️ 4b8d34e #2 2024-03-28 16:46:51 ~12 min tests/ui 📄log
✔️ 4b8d34e #2 2024-03-28 16:52:25 ~17 min linux/x86_64 📦tgz
✔️ 4b8d34e #2 2024-03-28 16:57:05 ~22 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 93d7476 #3 2024-04-04 08:53:27 ~7 min macos/aarch64 🍎dmg
✔️ 93d7476 #3 2024-04-04 08:53:38 ~7 min tests/nim 📄log
✔️ 93d7476 #3 2024-04-04 08:55:28 ~9 min macos/x86_64 🍎dmg
✔️ 93d7476 #3 2024-04-04 08:57:55 ~11 min tests/ui 📄log
✔️ 93d7476 #3 2024-04-04 09:03:54 ~17 min linux/x86_64 📦tgz
✔️ 93d7476 #3 2024-04-04 09:11:06 ~24 min windows/x86_64 💿exe
✔️ 86a39c3 #4 2024-04-08 06:52:20 ~5 min macos/aarch64 🍎dmg
✔️ 86a39c3 #4 2024-04-08 06:53:34 ~6 min tests/nim 📄log
✔️ 86a39c3 #4 2024-04-08 06:55:23 ~8 min macos/x86_64 🍎dmg
✔️ 86a39c3 #4 2024-04-08 06:58:18 ~11 min tests/ui 📄log
✔️ 86a39c3 #4 2024-04-08 07:01:22 ~14 min linux/x86_64 📦tgz
✔️ 86a39c3 #4 2024-04-08 07:21:52 ~34 min windows/x86_64 💿exe

@jrainville
Copy link
Member

@jrainville I'd really appreciate your thoughts here. It's still very much WIP, but I need to confirm the direction with you because this change is snowballing and I don't want to waste time if I'm missing some crucial detail and we shouldn't move this implementation in the chat section. I can't really find the reason why it was implemented in the communities module and this is why I'm not 100% sure the direction is good.

IIRC, the reason why we moved the models to the community module instead of the chat section one was because we use those models in the community portal as well. So even before the community is spectated, we want to be able to see what permissions they have.

image

I think maybe because you could access the community from the settings screen too.


All in all, I agree that having the model is the chat section is way better, but it's also a lot of work and it will break some parts like community portal and probably something else I forgot.

IMO, this work should be done for 2.29 and be analysed well beforehand, because like you saw, it can snowball and then you realize too late that you've broken one of the modules by accident.

@alexjba
Copy link
Contributor Author

alexjba commented Mar 28, 2024

@jrainville I'd really appreciate your thoughts here. It's still very much WIP, but I need to confirm the direction with you because this change is snowballing and I don't want to waste time if I'm missing some crucial detail and we shouldn't move this implementation in the chat section. I can't really find the reason why it was implemented in the communities module and this is why I'm not 100% sure the direction is good.

IIRC, the reason why we moved the models to the community module instead of the chat section one was because we use those models in the community portal as well. So even before the community is spectated, we want to be able to see what permissions they have.

image

I think maybe because you could access the community from the settings screen too.

All in all, I agree that having the model is the chat section is way better, but it's also a lot of work and it will break some parts like community portal and probably something else I forgot.

IMO, this work should be done for 2.29 and be analysed well beforehand, because like you saw, it can snowball and then you realize too late that you've broken one of the modules by accident.

The models used in the community portal have the token permissions and also the tokens requirements met flag. So we might get away with it.
I've moved forward with this because the only place I've found it being used if for the join community flows. But I agree it should be done with less pressure in 2.29. AFAIK the join community flows are already very fragile and this change has significant risks.

@alexjba alexjba force-pushed the 14095-review-the-model-used-in-shared-addresses-popup-since-permissions-are-not-dynamically-updated branch 2 times, most recently from 4b8d34e to 93d7476 Compare April 4, 2024 08:46
@alexjba alexjba force-pushed the 14095-review-the-model-used-in-shared-addresses-popup-since-permissions-are-not-dynamically-updated branch from 93d7476 to 86a39c3 Compare April 8, 2024 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review the model used in shared addresses popup since permissions are not dynamically updated
3 participants