mosaic icon indicating copy to clipboard operation
mosaic copied to clipboard

Evaluate using toLowerCase in backend API code

Open zjmiller opened this issue 5 years ago • 1 comments

A case mismatch between an email address in a spreadsheet (with the first letter capitalized) and an email address in the database (with the first letter not capitalized) led us to lowercase all of the emails addresses associated with an API request before comparing them to email addresses in the database.

This was a temporary solution, though. What should the long-term solution be?

Some options:

  1. Leave all emails alone and force the spreadsheet owners to make corrections if there's a mismatch.
  2. Use some sort of case-insensitive pattern matching on the backend like Postgres ILIKE.

zjmiller avatar Sep 06 '19 04:09 zjmiller

What's wrong with toLowerCasing them?

email addresses are case-insensitive, right?

I agree that something like 2. seems a bit more principled that toLowerCase, but IDK that it really matters

brachbach avatar Sep 12 '19 21:09 brachbach