I also reached out to them on Twitter but they directed me to this form. I followed up with them on Twitter with what happened in this screenshot but they are now ignoring me.

  • xantoxis@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    11 months ago

    Therefore the correct amount of validation is that which satisfies whatever format the underlying API requires.

    You mean the validation which the underlying API will perform on its own? You don’t need to do it.

    • elrik@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      11 months ago

      I disagree. You should have validation at each layer, as it’s easier to handle bad inputs and errors the earlier they are caught.

      It’s especially important in this case with email because often one or more of the following comes into play when you’re dealing with an email input:

      • You’re doing more than sending an email (for ex, creating a record for a new user).
      • The UI isn’t waiting for you to send that email (for ex, it’s handled through a queue or some other background process).
      • The API call to send an email has a cost (both time and money).
      • You have multiple email recipients (better hope that external API error tells you which one failed).

      I’m not suggesting that validation of an email should attempt to be exhaustive, but a well thought-out implementation validates all user inputs. Even the underlying API in this example is validating the email you give it before trying to send an email through its own underlying API.

      Passing obvious garbage inputs down is just bad practice.