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
RUSTSEC-2026-0543 marks chrono unmaintained, and #307 put it on cargo-deny's ignore list until replacing it could be its own release. This is that change: the Rust SDK moves to jiff 1.x, and the ignore comes out. basecamp/basecamp-sdk#1106 makes the same change there.
Why jiff, and why now
chrono's maintainer soft-deprecated it in January (Soft-deprecating chrono and chrono-tz chronotope/chrono#1768), declined a handover, and held the advisory "until after the jiff 1.0 release". jiff 1.0 shipped 2026-11-15 with "an indefinite commitment to 1.x.y. Consumers of this library should feel confident about putting Jiff types into their public API." The floor is 1.0.1 (which fixes an out-of-bounds timestamp parse). Its MSRV is 1.85, under our 1.88, so rust-version doesn't move.
time was the other candidate. It is still 0.x and has no tz database, which Date::today and from_datetime_in need. Its OffsetDateTime serde isn't RFC 3339, so every generated field would need a with attribute.
The crate has no reverse dependencies on crates.io.
What changes
Was
Now
DateTime = chrono::DateTime<Utc>
jiff::Timestamp
Date(pub chrono::NaiveDate)
Date(pub jiff::civil::Date)
<Date as FromStr>::Err = chrono::ParseError
jiff::Error
Date::from_datetime_in<Tz: chrono::TimeZone>
from_datetime_in(&DateTime, &jiff::tz::TimeZone)
Date::at_midnight_utc() -> DateTime
-> Option<DateTime> (None only for 9999-12-31)
chrono::Weekday in Date::weekday and Identity::set_first_week_day
jiff::civil::Weekday
Token::expires_at: Option<DateTime<Utc>>
Option<jiff::Timestamp>
(none)
pub use jiff;
The generator only names crate::types::{Date, DateTime}, so no generated code changes. MIGRATING.md has the upgrade notes.
What stays the same, and how it was checked
Instants. I compared chrono's DateTime<Utc> serde with jiff's Timestamp serde. They agree on Z, numeric offsets, a space separator, lowercase t/z and nine fractional digits. Both refuse a missing offset and a bare date. Output is byte-identical. They differ only at the edges: a leap second reads as :59, and more than nine fractional digits is refused.
Dates. jiff's own date parser accepts 20260304 and 2026-03-04T00:00:00. Date therefore parses with strptime("%Y-%m-%d"), which matches chrono's %Y-%m-%d, unpadded 2026-3-4 included. tests/dates.rs now refuses both of those wider forms. Date::default() stays 1970-01-01 (jiff's own default is year zero). add_months/add_years keep Go's AddDate rollover, which jiff's clamping arithmetic would not.
Date::today(). jiff reads the zone with tz-system. Without a tz database it would silently fall back to UTC for a TZ=America/Chicago setting and on Windows and Android, so the crate enables tzdb-zoneinfo, tzdb-bundle-platform and tzdb-concatenated. Checked against chrono::Local with TZ unset, Pacific/Kiritimati, Etc/GMT+12 and an unknown zone: the same date in all four.
Retry-After.jiff::fmt::rfc2822::parse agreed with chrono::DateTime::parse_from_rfc2822 on 14 of 14 forms. Those covered GMT, UT, EST, PDT, Z and military zones, a missing weekday, two-digit years, missing seconds, a wrong weekday (refused by both), extra spaces, lowercase and a (UTC) comment.
Stored OAuth tokens.expires_at is RFC 3339 UTC either way.
make rs-check rs-check-drift rs-consumer-check passes locally: lint, tests, docs, cargo deny (advisories ok with an empty ignore list) for both workspaces, generated code up to date, and the consumer build with and without default features.
cargo semver-checks will flag the break; the breaking label is on.
Summary by cubic
Replaces the deprecated chrono crate with jiff 1.x in the Rust SDK, and drops the cargo-deny ignore for RUSTSEC-2026-0543. The wire format is unchanged — instants stay RFC 3339 and dates stay YYYY-MM-DD — so stored OAuth tokens read back as before, and no generated code changes. This is a breaking release; MIGRATING.md has the before-and-after table.
Migration
DateTime is jiff::Timestamp, Date wraps jiff::civil::Date, and the crate re-exports hey_sdk::jiff.
Date::from_datetime_in takes a jiff::tz::TimeZone, and Date::at_midnight_utc returns Option<DateTime>, None at the calendar's ends.
Weekdays are spelled out: Weekday::Monday instead of Weekday::Mon.
Date still parses only %Y-%m-%d, Date::default() stays 1970-01-01, and add_months/add_years keep Go's AddDate rollover.
Date now prints through the same %Y-%m-%d it reads, so dates before year 0 still round-trip.
Written for commit a615987. Summary will update on new commits.
chrono is unmaintained (RUSTSEC-2026-0543; its maintainer wound it down
and pointed at jiff, and held the advisory for jiff 1.0, now out). The
crate's dates and instants move to jiff 1.x, which commits to a stable
1.x API, and the advisory comes off cargo-deny's ignore list.
- `DateTime` is `jiff::Timestamp`; `Date` wraps `jiff::civil::Date`;
the crate re-exports `hey_sdk::jiff`.
- The wire format is unchanged: RFC 3339 in, UTC with `Z` out, and
`YYYY-MM-DD` dates. `Date` still parses with `%Y-%m-%d` rather than
jiff's wider parser, which takes `20260304` and a datetime whose time
it drops, and `Date::default()` stays 1970-01-01.
- `Date::from_datetime_in` takes a `jiff::tz::TimeZone`; `weekday()` and
`Identity::set_first_week_day` use `jiff::civil::Weekday`;
`at_midnight_utc()` answers `Option`, since 9999-12-31's midnight is
past jiff's last instant. `add_months` keeps Go's rollover.
- `Date::today()` reads the system zone with jiff's tz-system and the
platform's time zone database (bundled on Windows), so `TZ` names and
Windows and Android zones resolve as they did with chrono's `Local`.
- Retry-After's RFC 2822 date parses with jiff, which agrees with
chrono on every form probed. OAuth `Token::expires_at` is
`Option<jiff::Timestamp>`; stored tokens read back as before.
The generator only names `crate::types::{Date, DateTime}`, so no
generated code changes. MIGRATING.md has the before-and-after table.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Negative-year dates fail to round-trip through JSON because serialization emits six year digits while the parser accepts at most four, requiring consistent formatting and a regression test.
Replaces chrono with jiff 1.x in the Rust SDK, completing the migration deferred in #307 and removing the temporary advisory exception. This changes public date/time types without changing generated code.
Changes:
Migrates dates, timestamps, weekdays, OAuth expiry, and retry timing to jiff.
Updates dependencies, tests, and the OAuth example.
Documents breaking API changes and re-exports jiff for consumers.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
File
Description
rust/hey-sdk/tests/services_identity.rs
Uses jiff weekday variants.
rust/hey-sdk/tests/retry_policy.rs
Builds retry dates with jiff.
rust/hey-sdk/tests/dates.rs
Migrates date tests and adds parsing checks.
rust/hey-sdk/tests/body_limit.rs
Updates retry-date test setup.
rust/hey-sdk/src/types.rs
Replaces core date/time types and arithmetic.
rust/hey-sdk/src/services/time_tracks.rs
Uses jiff for stop timestamps.
rust/hey-sdk/src/services/identity.rs
Migrates weekday mappings to jiff.
rust/hey-sdk/src/oauth.rs
Migrates token expiry timestamps and calculations.
rust/hey-sdk/src/lib.rs
Re-exports jiff for SDK consumers.
rust/hey-sdk/src/error.rs
Migrates Retry-After parsing and duration calculations.
rust/hey-sdk/examples/oauth_pkce.rs
Updates expiry timestamp formatting.
rust/hey-sdk/Cargo.toml
Replaces chrono with jiff and time-zone features.
rust/deny.toml
Removes the chrono advisory exception.
rust/Cargo.lock
Records the SDK dependency migration.
MIGRATING.md
Documents public API changes and upgrade guidance.
jiff's Display writes a negative year with six digits (-000001), which
the %Y-%m-%d that Date reads does not take, so such a date no longer
round-tripped through JSON as it did with chrono. Display now formats
with the same %Y-%m-%d; for years 0 to 9999 the output is unchanged.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The documentation omits None results for -9999-01-01 and -9999-01-02 in both types.rs and MIGRATING.md, leaving callers unaware of lower-bound timestamp failures.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Document all dates below Jiff's minimum timestamp
rust/hey-sdk/src/types.rs:87
None also occurs for -9999-01-01 and -9999-01-02, whose UTC midnights fall below jiff's minimum timestamp. Document all three dates so callers do not treat the lower-bound failures as impossible. The same correction is needed in MIGRATING.md:22.
… too
Timestamp::MIN is -9999-01-02T01:59:59Z, so -9999-01-01 and -9999-01-02
have no midnight UTC either; the doc and MIGRATING named only
9999-12-31. A test pins all three and the days beside them.
Fixed in a615987 (review). Timestamp::MIN is -9999-01-02T01:59:59Z, so -9999-01-01 and -9999-01-02 have no midnight UTC either. at_midnight_utc's doc and the MIGRATING row now name all three. only_the_calendar_ends_have_no_midnight_utc pins the three Nones and the days beside them, -9999-01-03 and 9999-12-30.
Review threads: 1 resolved (1 fixed). The negative-year round-trip was fixed in fb681ee.
Review bodies: 1 finding answered (1 fixed).
Fixed from a review body: at_midnight_utc's None cases. The doc, MIGRATING and a test now name -9999-01-01, -9999-01-02 and 9999-12-31 (a615987).
Not reported on the head: Copilot, on a615987. It was re-requested once after the empty CodeQL-rerun commit 5ca52fd. a615987 changes only a doc comment, a MIGRATING row and a test.
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.
RUSTSEC-2026-0543 marks chrono unmaintained, and #307 put it on cargo-deny's ignore list until replacing it could be its own release. This is that change: the Rust SDK moves to jiff 1.x, and the ignore comes out. basecamp/basecamp-sdk#1106 makes the same change there.
Why jiff, and why now
rust-versiondoesn't move.timewas the other candidate. It is still 0.x and has no tz database, whichDate::todayandfrom_datetime_inneed. ItsOffsetDateTimeserde isn't RFC 3339, so every generated field would need awithattribute.What changes
DateTime=chrono::DateTime<Utc>jiff::TimestampDate(pub chrono::NaiveDate)Date(pub jiff::civil::Date)<Date as FromStr>::Err=chrono::ParseErrorjiff::ErrorDate::from_datetime_in<Tz: chrono::TimeZone>from_datetime_in(&DateTime, &jiff::tz::TimeZone)Date::at_midnight_utc() -> DateTime-> Option<DateTime>(Noneonly for 9999-12-31)chrono::WeekdayinDate::weekdayandIdentity::set_first_week_dayjiff::civil::WeekdayToken::expires_at: Option<DateTime<Utc>>Option<jiff::Timestamp>pub use jiff;The generator only names
crate::types::{Date, DateTime}, so no generated code changes. MIGRATING.md has the upgrade notes.What stays the same, and how it was checked
DateTime<Utc>serde with jiff'sTimestampserde. They agree onZ, numeric offsets, a space separator, lowercaset/zand nine fractional digits. Both refuse a missing offset and a bare date. Output is byte-identical. They differ only at the edges: a leap second reads as:59, and more than nine fractional digits is refused.20260304and2026-03-04T00:00:00.Datetherefore parses withstrptime("%Y-%m-%d"), which matches chrono's%Y-%m-%d, unpadded2026-3-4included.tests/dates.rsnow refuses both of those wider forms.Date::default()stays 1970-01-01 (jiff's own default is year zero).add_months/add_yearskeep Go'sAddDaterollover, which jiff's clamping arithmetic would not.Date::today(). jiff reads the zone withtz-system. Without a tz database it would silently fall back to UTC for aTZ=America/Chicagosetting and on Windows and Android, so the crate enablestzdb-zoneinfo,tzdb-bundle-platformandtzdb-concatenated. Checked againstchrono::Localwith TZ unset,Pacific/Kiritimati,Etc/GMT+12and an unknown zone: the same date in all four.jiff::fmt::rfc2822::parseagreed withchrono::DateTime::parse_from_rfc2822on 14 of 14 forms. Those covered GMT, UT, EST, PDT,Zand military zones, a missing weekday, two-digit years, missing seconds, a wrong weekday (refused by both), extra spaces, lowercase and a(UTC)comment.expires_atis RFC 3339 UTC either way.make rs-check rs-check-drift rs-consumer-checkpasses locally: lint, tests, docs,cargo deny(advisories okwith an empty ignore list) for both workspaces, generated code up to date, and the consumer build with and without default features.cargo semver-checkswill flag the break; thebreakinglabel is on.Summary by cubic
Replaces the deprecated
chronocrate withjiff1.x in the Rust SDK, and drops the cargo-deny ignore for RUSTSEC-2026-0543. The wire format is unchanged — instants stay RFC 3339 and dates stayYYYY-MM-DD— so stored OAuth tokens read back as before, and no generated code changes. This is a breaking release;MIGRATING.mdhas the before-and-after table.Migration
DateTimeisjiff::Timestamp,Datewrapsjiff::civil::Date, and the crate re-exportshey_sdk::jiff.Date::from_datetime_intakes ajiff::tz::TimeZone, andDate::at_midnight_utcreturnsOption<DateTime>,Noneat the calendar's ends.Weekday::Mondayinstead ofWeekday::Mon.Datestill parses only%Y-%m-%d,Date::default()stays 1970-01-01, andadd_months/add_yearskeep Go'sAddDaterollover.Datenow prints through the same%Y-%m-%dit reads, so dates before year 0 still round-trip.Written for commit a615987. Summary will update on new commits.