Skip to content

Fix year-boundary slot gap in normalise_dates#33

Open
jnioche wants to merge 1 commit into
mainfrom
fix/year-boundary-slot
Open

Fix year-boundary slot gap in normalise_dates#33
jnioche wants to merge 1 commit into
mainfrom
fix/year-boundary-slot

Conversation

@jnioche

@jnioche jnioche commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #6 (the remaining missing 30-minute slot after the original workaround).

  • Root cause: the old code clipped year-crossing chunks to Jan 1 00:00, which made the chunk's API URL end at Jan 1 00:01Z — still a cross-year request. The API silently truncates those at Dec 31 23:00, so the Dec 31 23:30 slot and (depending on end date) earlier slots were missed.
  • Fix: split 30 min before year end (Dec 31 23:30) instead, keeping the URL within the current year. The next chunk then starts cleanly at Jan 1 00:00.
  • Known limitation: the Dec 31 23:30 slot (whose to field is Jan 1 00:00) is permanently inaccessible from the API — confirmed by direct API testing. No request (cross-year or within-year) returns it.
  • TLS: switched reqwest to rustls-tls (default-features = false) so unit tests compile without requiring libssl-dev.

Test plan

  • normalise_dates_splitting — updated to expect Dec 31 23:30 as last boundary
  • normalise_dates_skipping_year — updated to expect Dec 31 23:30 / Jan 1 split
  • normalise_dates_year_boundary_slot — new test verifying boundary structure for any cross-year range
  • normalise_dates_end_within_current_year — new regression test: ranges that stay within a year are unaffected
  • All 17 tests pass (cargo test)

🤖 Generated with Claude Code

Split 30 min before year end instead of at Jan 1 00:00. The old boundary
produced a cross-year URL (end = Jan 1 00:01Z) that the API silently
truncates at Dec 31 23:00. The new boundary keeps chunk URLs within the
current year, then restarts cleanly at Jan 1. The Dec 31 23:30 slot
(whose 'to' is Jan 1 00:00) remains inaccessible — this is an API
limitation, not a library bug.

Also switches reqwest to rustls-tls so unit tests compile without
requiring libssl-dev.

Closes #6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

day skipped when querying a date range straddling 2 years

1 participant