How many times can one apply to a group?

hi, in our forum it seems that one can try applying to a group once in every 24 hours.
We have a daily limit on how many times that action can be taken. Please wait 23 hours before trying again.

is there a setting to change this limit?

I couldn’t find one. I’d appreciate for help and hints.


update: it seems that this limit is different for different forums, as reported 9 min in this topic, but I couldn’t find where to tune this limit in the admin panel.

3 Likes

I get that too, but in a different message:

You have performed this action too many times. Please wait XX hours before trying again.

From what I saw in the admin>customize section this is coming from the rate_limiter.too_many_requests but I can’t find anything that will disable it or change it. Anyone knows how we can customize this rate_limiter?

Yeah this is a bug… I don’t really see why we would do it this way anymore:

https://github.com/discourse/discourse/blob/35a866fe229ffe6a22b947a671c82c1bcc7dec51/app/controllers/groups_controller.rb#L411-L413

Which later calls:

https://github.com/discourse/discourse/blob/35a866fe229ffe6a22b947a671c82c1bcc7dec51/app/controllers/groups_controller.rb#L442-L442

To me it looks like we are simply missing a unique index on group_requests you should only ever be allowed to have one group request per group in flight.

The problem though is that we are being a bit over aggressive here:

https://github.com/discourse/discourse/blob/35a866fe229ffe6a22b947a671c82c1bcc7dec51/app/controllers/groups_controller.rb#L339-L344

So we should change this:

  1. Add a unique index on group_requests(group_id, user_id) so only one request can be in-flight

  2. Remove the rate limit it makes no sense

  3. If someone (via api) requests membership to a group and they already have a request in flight, an error should be returned

  4. If someone (via api) requests membership they are already a member of, an error should be returned

  5. If someone (via api) requests membership to an invalid group (does not exists, or does not allow requests) an error should be returned.

I am on the fence about how to deal with repeat rejected group requests, BUT do not want to invent a problem here with fancy solutions, lets see what people say. I can think of cases where you would be rejected from a group one day, then provide better proof and then be accepted.

@nbianca can you sort this out?

6 Likes

we have a use case that fits the repeated requests and may be useful to others:

we ask people to send their proposals or answers to a specific challenge as a request when they want to apply to a specific group.

e.g. it’s a philosophy group, a philosophy question has been asked, and students should send their answers to the group if they want to join the group.

sometimes the question is an open problem, and we don’t want to limit them to only one suggestion! and those who can think diversely can join the group at the end.


so may it be the same as before, several application, but with a tune-able rate limit? e.g. admins can put the limit empty, so that every one can only apply once to a group, or they can set it to time “t” so that everyone can apply every t seconds?

The new design introduces automatic rate limiting.

If you apply for group X, you can no longer apply for group X until the group manager decides if you are approved or denied.

The issue I was hinting at was

What if there is a nasty user that keeps applying over and over and over to group X and getting rejected and so on.

I think for now I am comfortable leaving this to admins. If someone is being such a pain, raise with mods / admins and just ban the account.

6 Likes

This has been fixed by:

https://github.com/discourse/discourse/pull/7399

3 Likes