Repository navigation
fix: preserve fractional seconds in datetime query parameters - #147
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
|
|
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.
Datetime query parameters are currently formatted with
time.RFC3339, which omits fractional seconds. This truncates values such as2026-10-25T12:34:56.123456789Zto2026-10-25T12:34:56Z.That changes exclusive audit-log
starting_fromcursors and paginationas_of_timesnapshots. In particular, replaying a fractional audit-log cursor can revisit earlier entries within the same second.Use
time.RFC3339Nanoin both the generator template and generated client. Whole-second timestamps retain their existing representation, and timezone offsets are preserved. Add a changelog entry under Unreleased/Fixed.Eight public-method request cases exercise
ListAuditLogsandListApiKeyswith nanoseconds, microseconds, a non-UTC offset, and whole seconds. Each captures the actual query sent through an in-memory HTTP transport and compares the parsed instant with the input. Before the fix, six precision cases fail and two whole-second controls pass.Validation:
go test -race ./... -count=1 -v: passes, including all eight new request cases and existing header tests.go vet ./...,make validate, gofmt checks, andgit diff --check: pass.No hosted Cloud API calls or credentials were used. Generator Docker regeneration, shell automation tests, and the platform/Go-version matrix were not run. The template and generated formatter have the same one-line change. Developed with Codex assistance and reproduced locally.