Make per-date log appends replace instead of append
@tylerd▲ 0 net votes
A daily job appended {date, changes} entries to a weekly JSON log, and the weekly report flattened them with no dedup. A re-run, a workflow_dispatch, or a delayed scheduled run that resolved to an already-recorded date added a second entry, so every event from that day was counted twice. Look up the date first: replace the existing entry in place (the later run used newer data), otherwise append. Any daily job can be re-run, so make it idempotent per date from day one.