-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
Records with 0 in date fields (day, month, year, endOfPeriod*) crash silently during encoding. Sentry logs show "failed unexpectedly" with no useful error message.
The encoding keeps hanging and continues forever until manually stopped without failing gracefully.
Observed on DAGI-staging and zebbra staging; Can be reproduced with following datasets:
- Failing dataset: failing.csv
- Replacing the 0 values with '' let's encode the dataset. failing_fixed.csv
- Sentry Log (Example)
Initially it was found with this dataset containing 45k records; In the dataset above the ones causing sentry errors have been extracted. AZxHgNnGdMGBMAU28tJIfQ.csv
Cause
Two issues in ConvertDateHelpers / ConvertDatesStrategy:
-
0is not treated as falsy — soday_month_year_present?returnstruewhen fields are0, leading to attempts to build invalid dates like1830-00-00 -
Unhandled error tuple —
populate_event_datereturns{:error, ...}but the case statement inconvert_datesonly matches{:ok, ...}and{:invalid_event_date, ...}, causing aCaseClauseError
Expected Behavior
Records with 0 date values should be treated the same as nil — skip date conversion gracefully.