Closed russtuck closed 2 months ago
If a piece of data does not exist (i.e. birthday) it's not appropriate IMO to return a "valid" value for that requested data point. Rather, you should return null or throw some type of exception. I would rather have this return null and be handled in calling methods.
This is sending an HTTP response of type DateType, so returning null doesn't seem like an option. I considered a different HTTP response code, but neither 400 nor 500 seems right. I could return a more complex structure, but a date before anyone living was born seems simpler and robust. (If we were sending plain JSON without type checking, then an empty string would work. But type checking overall is good.)
Over 1000 users have missing birthdays, in prod and train. Instead of throwing an exception that is ultimately ignored, just return a default value (0 ticks).
UI only uses this for birthday confetti. Is it better to do that on the wrong day, or never? The UI can decide.