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

Limit number of members in a community and number of pending requests #5105

Merged
merged 3 commits into from
May 1, 2024

Conversation

jrainville
Copy link
Member

Needed for status-im/status-desktop#14532

Once the limit of members is reached, the community switches to On Request (manual approval).

Also, I put a limit on the number of pending requests in case the spam gets crazy.

I added a test that I ran a hundred times (I can run it more if we want, but it's long 💀 )

@status-im-auto
Copy link
Member

status-im-auto commented Apr 30, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9fe7e64 #1 2024-04-30 21:33:09 ~3 min linux 📦zip
✔️ 9fe7e64 #1 2024-04-30 21:34:41 ~4 min ios 📦zip
✔️ 9fe7e64 #1 2024-04-30 21:35:26 ~5 min android 📦aar
✔️ 9fe7e64 #1 2024-04-30 22:13:42 ~43 min tests 📄log
✔️ 97f4714 #2 2024-05-01 13:25:24 ~1 min android 📦aar
✔️ 97f4714 #2 2024-05-01 13:26:44 ~3 min ios 📦zip
✔️ 97f4714 #2 2024-05-01 13:27:02 ~3 min linux 📦zip
✔️ 97f4714 #2 2024-05-01 14:04:46 ~41 min tests 📄log

@@ -2816,6 +2833,15 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, receiver
}
}

// Check if we reached the limit, if we did, change the community setting to be On Request
if community.AutoAccept() && community.MembersCount() >= maxNbMembers {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to restore PermissionAccess to original value when the there's less nu members again? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a good idea, but I'll keep it simple for now. In theory, if we do reach the limit and the app still behaves nicely, we would create a new build with a higher limit first.

@jrainville jrainville merged commit 62fa322 into release/0.177.x May 1, 2024
6 checks passed
@jrainville jrainville deleted the feat/limit-nb-members branch May 1, 2024 14:09
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.

None yet

4 participants