Skip to content

Devin/1785530966 fix redelivery datetime precision - #1087

Open
willkendall01 wants to merge 4 commits into
auth0:masterfrom
fern-demo:devin/1785530966-fix-redelivery-datetime-precision
Open

Devin/1785530966 fix redelivery datetime precision#1087
willkendall01 wants to merge 4 commits into
auth0:masterfrom
fern-demo:devin/1785530966-fix-redelivery-datetime-precision

Conversation

@willkendall01

Copy link
Copy Markdown

Changes

Fixes the date_from / date_to sub-second-precision bug on event-stream redelivery (auth0/auth0.net#1067).

Auth0's redelivery schema declares these fields as { "type": "string", "format": "date-time", "maxLength": 20 }. DateTimeSerializer emits millisecond precision (...00.000Z, 24 chars), so POST /event-streams/{id}/redeliver returns HTTP 400 and Redeliveries.CreateAsync is unusable.

Fix: a per-property Rfc3339SecondsDateTimeConverter applied to CreateEventStreamRedeliveryRequestContent.DateFrom / .DateTo only. It emits seconds-only RFC 3339 (20 chars) and preserves the caller's wall-clock value — Utc as-is, Local converted, Unspecified labeled Z without shifting (no shift matches current for Unspecified). The global Constants.DateTimeFormat is untouched, so no other endpoint changes. The converter, its tests, and the request-content file are in .fernignore to survive regeneration.

Behavior

DateFrom = <value> → serialized date_from (host at UTC−4):

Input Old → result New
new DateTime(2026, 7, 1) (Unspecified) 2026-07-01T00:00:00.000400 2026-07-01T00:00:00Z
…, DateTimeKind.Utc 2026-07-01T00:00:00.000Z400 2026-07-01T00:00:00Z
…, DateTimeKind.Local 2026-07-01T00:00:00.000-04:00400 2026-07-01T04:00:00Z

Testing

  • Rfc3339SecondsDateTimeConverterTest (unit) — serialization per DateTimeKind, sub-second truncation, round-trip.
  • RedeliveryDateSerializationTest (WireMock) — asserts date_from/date_to on the wire through the real serializer + HTTP pipeline.

Local: full Auth0.ManagementApi.Test suite → Failed: 0, Passed: 748. No GitHub Actions CI configured; no tenant creds for the live integration tier.

  • This change adds unit test coverage
  • This change adds integration test coverage (WireMock, no live tenant)
  • This change has been tested on the latest version of the platform/language — no tenant creds

References

Checklist

  • All existing and new tests complete without errors

fern-api Bot and others added 4 commits August 3, 2026 23:24
… requests

Auth0's redelivery endpoint declares date_from/date_to as format: date-time with maxLength: 20 and rejects sub-second precision. The default DateTime serializer emitted millisecond precision (24 chars), causing HTTP 400. Apply a seconds-precision RFC 3339 converter to those two fields.
…edelivery

Rfc3339SecondsDateTimeConverter.Write previously called ToUniversalTime()
unconditionally. That treats an Unspecified-kind DateTime as local time and
silently shifts the instant by the host machine's UTC offset, so the common
`new DateTime(2026, 7, 1)` pattern (Kind == Unspecified) serialized to a
timezone-dependent value.

Normalize per Kind instead: Utc as-is, Local converted, Unspecified labeled
UTC without shifting the clock. This preserves the caller's wall-clock value
while still emitting the spec-compliant 20-character seconds-only string.

Strengthen tests: pin the timezone-independent Unspecified behavior and verify
the Local case converts to the equivalent UTC instant.

Co-Authored-By: Claude <noreply@anthropic.com>
@willkendall01
willkendall01 requested a review from a team as a code owner August 4, 2026 03:32
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.

1 participant