operationcode-pybot
operationcode-pybot copied to clipboard
Rate Limit on Mentor Requests
There exists a possibility that someone could put in a ridiculous amount of mentor requests, pinging the same mentors over and over again. Mentors would possibly then be encouraged to just mute the #mentors-internal channel, which would stop legitimate mentor requests from being answered in a timely fashion.
A rate limit should exist so that a given user can only put in a limited amount of mentor requests in a given time period. 3x per month was suggested, so let's start with that and see how it goes.
Acceptance criteria:
When attempting to put in too many mentor requests in a month, the user should see a message from slackbot informing them that they've put in as many mentor requests as allowed until the time when they'll be allowed to put it in again. For example:
Error: you have put in too many mentor requests. You will be allowed to submit another mentor request on June 15, 2020
The above message would be if the first of 3 mentor requests was put in on May 15, 2020.
When a mentor request is made, I think there should also be a message like,
You currently have 2 requests remaining for this month.
This will provide a good user experience by letting them know:
- There is a limit to mentor requests.
- How many they have remaining.
I like that, that does improve the user experience. Also documenting this feedback from slack here:
Instead of limiting total mentor requests, maybe limit the number of requests per category?
Should include a message like "Please request assistance in #help or in the appropriate channels for group feedback" when you've reached the limit
I'm still fairly new to the world of slack bot scripting, so forgive my noobish question. When it comes to features like this, is there an easy way for the bot to track exactly how many times a particular user has used a feature in a given time period? Or would a backend tracker have be built that adds a counter to the user each time the mentor request is used?
Since we're using Airtable to track the requests, I imagine you could just pull the data from airtable and then analyze it to see if they've hit the limit. From a UX perspective, we want to let the user know how many they have left, so you'll need to put this logic in the right place to be able to do that
Ah that makes sense, thanks for the info :)
Hey @wskinner74 , are you actively working on this issue? If now, I'd like to give it a shot.
@chynh I'm not actively working on it, feel free to run with it!
@aaron-suarez Would you be able to provide me with an airtable api key so I can work on this? Also, was wondering if you could add a new column to this table as that is a part of the solution that I had in mind.
@chynh I'd prefer not to give an airtable API key to production for development purposes. I think I can make you a copy of a staging table and you can do whatever you want with your own copy of the table. I just want to make sure all actual PII has been removed, so give me a bit to look into that.
Thanks for your efforts here!
@aaron-suarez Makes sense. As long as there's something I can work with. I think I would have to come up with a workaround in the end since I know submitting mentor request would query mentor table as well.
@sairina is helping me scrub PII out of the table so we can make a copy for you. Once we have that complete, we'll connect with you to give you access to the dev table. Thanks for your patience on this!
@chynh Thanks to @sairina we now have a version of the table that is PII free! 🙌
If you can connect with me on slack or over email, I can invite you to that airtable base and you can get the API key and start working on this issue 😄
@aaron-suarez - after working on this a bit for the rewrite, I think 3x requests per month is probably a little low. How about 3x requests per week? In the last couple years I haven't seen this issue happen, so I'd rather make a higher limit and then lower it later if needed than a lower limit that we have to raise.
My current implementation is to have a new View on the Mentor Requests Airtable table that only shows requests in the last month (can also do last week). We search this for the mentee's name and count them that way. Any time frame should be easy to do. I've also modified the mentorship_request_received
message to show whatever limit we decide on.