codeforanchorage / courtbot

Your friendly neighborhood court robot. Provides an api for getting court case information.
https://courtbot.codeforanchorage.org
ISC License
7 stars 10 forks source link

Signing up twice for reminders. #55

Closed mark-meyer closed 6 years ago

mark-meyer commented 7 years ago

What should happen is someone signs up for a reminder twice with the same case ID and phone number? I think we currently end up with two reminders in the DB and they'll get sent two reminders. It might be nice if we could sent a message saying we already have a reminder scheduled.

mfrederickson commented 7 years ago

And maybe ask if they want to cancel it?

tescher commented 7 years ago

There's a whole flow we need to work out with criminal cases because of their multiple hearings. This includes being able to stop reminders.

Tim Escher tim@eschers.com 608 432 5799

On Sep 13, 2017 2:58 PM, "Marvin Frederickson" notifications@github.com wrote:

And maybe ask if they want to cancel it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/codeforanchorage/courtbot/issues/55#issuecomment-329279738, or mute the thread https://github.com/notifications/unsubscribe-auth/ACcF3G9-0zf9gWDhIRvAACrHuVOghbBaks5siDPrgaJpZM4PVbeG .

mark-meyer commented 7 years ago

I posted a v2 (and deleted the older update_libs) branch that I think is a good start dealing with this (and also adds basic logging).

Basically when a user signs up for notifications they stay in the system. We keep track of when we send notifications so we know if we have already sent a notification for a particular case_id/datetime. If another hearing shows up at a different time, they'll get another notification.

If a user enters a case that they are already following it will offer to let them unsubscribe by sending 'Delete'. This marks the requests as inactive. We could offer instructions if they enter Delete with no case number set on the session.

In general, I think we should reply to bad input with instructions rather than the 'couldn't find your case' message. I added (slightly) better matching on user input, so we have a good idea if the user sends something that's clearly not a case numbers. And the middleware in web.js is restructured so it's a little easier to add catches for various words.