Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore missing birthdays #1052

Merged
merged 3 commits into from
Jun 21, 2024
Merged

Ignore missing birthdays #1052

merged 3 commits into from
Jun 21, 2024

Conversation

russtuck
Copy link
Member

@russtuck russtuck commented Jun 5, 2024

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.

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.
@bennettforkner
Copy link
Contributor

bennettforkner commented Jun 7, 2024

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.

@russtuck
Copy link
Member Author

russtuck commented Jun 7, 2024

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.)

@russtuck russtuck requested a review from amos-cha June 10, 2024 21:10
@russtuck russtuck merged commit 46c33bb into develop Jun 21, 2024
3 checks passed
@russtuck russtuck deleted the s24-ignore-missing-birthday branch June 21, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants