Devin/1785530966 fix redelivery datetime precision - #1087
Open
willkendall01 wants to merge 4 commits into
Open
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixes the
date_from/date_tosub-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 }.DateTimeSerializeremits millisecond precision (...00.000Z, 24 chars), soPOST /event-streams/{id}/redeliverreturns HTTP 400 andRedeliveries.CreateAsyncis unusable.Fix: a per-property
Rfc3339SecondsDateTimeConverterapplied toCreateEventStreamRedeliveryRequestContent.DateFrom/.DateToonly. It emits seconds-only RFC 3339 (20 chars) and preserves the caller's wall-clock value —Utcas-is,Localconverted,UnspecifiedlabeledZwithout shifting (no shift matches current forUnspecified). The globalConstants.DateTimeFormatis untouched, so no other endpoint changes. The converter, its tests, and the request-content file are in.fernignoreto survive regeneration.Behavior
DateFrom = <value>→ serializeddate_from(host at UTC−4):new DateTime(2026, 7, 1)(Unspecified)2026-07-01T00:00:00.000→ 4002026-07-01T00:00:00Z…, DateTimeKind.Utc2026-07-01T00:00:00.000Z→ 4002026-07-01T00:00:00Z…, DateTimeKind.Local2026-07-01T00:00:00.000-04:00→ 4002026-07-01T04:00:00ZTesting
Rfc3339SecondsDateTimeConverterTest(unit) — serialization perDateTimeKind, sub-second truncation, round-trip.RedeliveryDateSerializationTest(WireMock) — assertsdate_from/date_toon the wire through the real serializer + HTTP pipeline.References
Checklist