-
Notifications
You must be signed in to change notification settings - Fork 242
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
Conversation
Jenkins Builds
|
@@ -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 { |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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.
9fe7e64
to
97f4714
Compare
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 💀 )