fix(tracking): parse RFC3339 timestamps in first_seen_days()#2711
Open
guyoron1 wants to merge 1 commit into
Open
fix(tracking): parse RFC3339 timestamps in first_seen_days()#2711guyoron1 wants to merge 1 commit into
guyoron1 wants to merge 1 commit into
Conversation
Timestamps are stored via Utc::now().to_rfc3339() but first_seen_days() parsed with NaiveDateTime format "%Y-%m-%dT%H:%M:%S" which rejects the fractional seconds and timezone offset, silently falling back to Utc::now() and always returning 0 days. Use DateTime::parse_from_rfc3339() as primary parser (matching line 951 in the same file), keeping NaiveDateTime formats as fallbacks for older databases. Fixes rtk-ai#2710
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.
Summary
first_seen_days()which always returns 0 due to timestamp parse format mismatch2026-06-28T12:00:00.123456+00:00) but parsed withNaiveDateTimeformat%Y-%m-%dT%H:%M:%S— missing fractional seconds and timezone offsetUtc::now(), making(now - now).num_days()always 0DateTime::parse_from_rfc3339()as primary parser (matching the existing correct usage on line 951 in the same file)NaiveDateTimeformats as fallbacks for databases created by older RTK versionsTest plan
test_first_seen_days_parses_rfc3339test verifying the function returns non-negative dayscargo clippy --all-targetspassescargo test --allpassesFixes #2710