Marwan01 / covid-helpline

Helping spread communication about novel virus Covid-19 via FREE text messages for everyone.
https://marwan01.github.io/covid-helpline/
MIT License
22 stars 5 forks source link

Set a limit for texts /person/day #7

Open Marwan01 opened 4 years ago

Marwan01 commented 4 years ago

Stop people from spamming app and using up credits. Some people and bots will abuse the number as it scales in users. We need to create a way to prevent that from happening programmatically.

A counter for how many messages are left for each user. Set a counter that will tell you how many messages are left for that user for that day, and stop him from interacting with twilio servers when threshold is reached.

Alternatives would be calling Twilio and asking them for solution for it This would be great to talk about worldwide capability as well.

Marwan01 commented 4 years ago

https://www.twilio.com/docs/verify/api/programmable-rate-limits

ajayraj commented 4 years ago

Found that in docs as well, working on it!

ajayraj commented 4 years ago

Very heavily linked with Verifications, which we are not using currently in sending/receiving. Checked with them on a few areas I was confused, waiting on a response. Stack overflow seems sparse in saying if using this for rate limiting how we're doing is possible. Waiting on a response, pushed some changes to new branch for rate limit testing.

Marwan01 commented 4 years ago

Awesome work @ajayraj ! You definitely seem on the right track. I looked into this issue a while ago and came across the verification stuff as well, but I avoided it thinking we could implement something within the code to avoid the cost. But that most likely won't stop the cost of incoming sms. Still thought of throwing the idea out there! But please do look into the verification if it seems like the reasonable choice to go with.

ajayraj commented 4 years ago

Thanks! Yeah at this point it seems necessary to use verifications for it, I got an email back just now and I'm going to work on it some more, probably will have to contact them another time though