You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse unix nanosecond dates in the generated models - #6807
ExactDate and IsoDateAdapter are regenerated from the updated generator templates. A digits-only value is read as unix nanoseconds; strings keep the existing path.
ExactDate.raw holds a nanosecond date as RFC 3339 with 9 fractional digits, so it has the same format whichever API version sent it.
IsoDateAdapter now returns a copy of the cached Date, as the generator emits it.
No behaviour change on the current endpoints, which still send strings.
Testing
ExactDateParsingTest and IsoDateAdapterTest cover JSON numbers, quoted digits and zero-padded fractions.
V2PayloadParsingTest parses a v2 message.new frame through Serializer.moshi and checks its dates and custom data.
Smoke run on the compose sample (channel list, channel, send, reaction, thread reply, search, threads) with no parse errors.
Improved date handling for Unix nanosecond timestamps, including quoted and unquoted values. Timestamps now retain their full precision in the raw date value while mapping to the correct millisecond date.
Improved compatibility when parsing responses containing unrecognized enum values, helping preserve data from newer or differing server responses.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
📝 Walkthrough
Walkthrough
The date adapters now parse digit-only Unix-nanosecond values. ExactDate preserves nanosecond precision in its raw RFC 3339 value, while its stored instant and IsoDateAdapter dates use millisecond precision. Serializer configuration registers additional network-model adapters and the client ExactDateAdapter. Tests cover date parsing, enum handling, and message.new payload mapping.
Priority: ➖ Normal
Merge Risk:⚪ Minimal · up to de2a0
No actionable issue is established for the date-parsing and serializer changes; the PR is mergeable after normal checks.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 7 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary change: parsing Unix nanosecond dates in generated models.
Description check
The description includes the goal, implementation details, testing coverage, issue context, and smoke-test results. The UI and checklist sections are omitted, but they are not relevant to this non-UI …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
I’m a rabbit, hopping through each date, Nine bright digits mark the fraction’s place. I nibble JSON, both quoted and bare, Then map a message with dates to spare. The adapters settle, the tests all run, I twitch my nose and call it done.
Comment @coderabbitai help to get the list of available commands.
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
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.
Goal
Let the generated models parse v2 dates, which arrive as unix nanosecond integers instead of RFC 3339 strings.
Part of AND-1637
Implementation
ExactDateandIsoDateAdapterare regenerated from the updated generator templates. A digits-only value is read as unix nanoseconds; strings keep the existing path.ExactDate.rawholds a nanosecond date as RFC 3339 with 9 fractional digits, so it has the same format whichever API version sent it.IsoDateAdapternow returns a copy of the cachedDate, as the generator emits it.No behaviour change on the current endpoints, which still send strings.
Testing
ExactDateParsingTestandIsoDateAdapterTestcover JSON numbers, quoted digits and zero-padded fractions.V2PayloadParsingTestparses a v2message.newframe throughSerializer.moshiand checks its dates and custom data.🤖 Generated with Claude Code
Summary by CodeRabbit