FoveaCentral / vaccinesignup

A Twitter bot that notifies users about available vaccine appointments
https://twitter.com/vaccinesignup
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

90031 returns false matches #7

Closed ivanoblomov closed 3 years ago

ivanoblomov commented 3 years ago

Will DM'd 90031 to @vaccinesignup and received matches for 90003:

image

Extracted from #2.

ivanoblomov commented 3 years ago

This is a weird one I can't replicate. After recreating my local db from scratch and syncing the location data with LA County, using the same expression from the code returns the expected results:

[5] pry(main)> Location.where('addr2 LIKE ?', "%90031%").map{ |l| l['addr2'] }
  Location Load (0.9ms)  SELECT "locations".* FROM "locations" WHERE (addr2 LIKE '%90031%')
=> [
    [0] "Los Angeles, CA 90031",
    [1] "Los Angeles, CA 90031",
    [2] "Los Angeles, CA 90031"
]

Not sure what happened here.

wraasch commented 3 years ago

The bot DMed me again at 9:53pm with the same list. I am currently "subscribed" to 90044 and 90031. Is it possible that 90044 is the issue? Or perhaps subscribing to 2 zip codes causes an issue?

image

ivanoblomov commented 3 years ago

That 9:53 DM was my fault. My local environment was still pointing to the real account and I only caught it last night. This is fixed now.

Still having trouble recreating the 90003 bug, though. Should have time to dig deeper later this week, but note the two open PRs ready for review. Would like to deploy those soon as it seems the account is getting a lot of usage today. No doubt because of that great post you made. ;)

On Mar 16, 2021, at 1:32 AM, wraasch @.***> wrote:

 The bot DMed me again at 9:53pm with the same list. I am currently "subscribed" to 90044 and 90031. Is it possible that 90044 is the issue? Or perhaps subscribing to 2 zip codes causes an issue?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe.

wraasch commented 3 years ago

OK they are approved! Caveat that I have exactly zero experience with Ruby. That said, I am kind of enjoying going through the code knowing the context of what you are working to accomplish. It's my favorite way to learn!

ivanoblomov commented 3 years ago

Cheers! No worries on the experience. As you can see, it’s quite similar to Python. Plus another experienced pair of eyeballs, regardless of language, always helps.

And if you have any questions, let me know. Always happy to help spread the gospel of Ruby!

On Mar 17, 2021, at 1:15 AM, wraasch @.***> wrote:

 OK they are approved! Caveat that I have exactly zero experience with Ruby. That said, I am kind of enjoying going through the code knowing the context of what you are working to accomplish. It's my favorite way to learn!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or unsubscribe.

wraasch commented 3 years ago

FYI this is a screenshot of the latest DM. It looks like it is treating the 90003 as a separate query, so sometime along the way, the bot registered my Twitter as assigned to 90003. In my DM history, 90031 and 90040 were the only zip codes that I messaged (though they were set in quick succession, if that matters).

It's probably not the biggest deal, though I wonder if it would make sense to enable an unsubscribe to zip codes. For instance, if I message the word "unsubscribe" or "stop", the bot will erase any zip codes within that DM from the query. In this case "unsubscribe 90003" or "stop 90003" would keep 90031 and 90040, but remove the unwanted zip from my query. If I don't include a zip code (ie "stop"), then it stops all messages, as you currently have it programmed. Might be too much complexity, just typing out loud :)

image

ivanoblomov commented 3 years ago

Holding off on this until we make calls on the streaming version and Ruby vs Python.

ivanoblomov commented 3 years ago

Closing since we're rewriting the DM functionality (DirectMessageReader and NotifyBot) in Python. Can open if bug recurs with the new code.