fix(api): serialize response datetimes as UTC - #2220
Open
justonemorenight wants to merge 1 commit into
Open
Conversation
justonemorenight
requested review from
RaghavChamadiya and
swati510
as code owners
September 11, 2026 13:36
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.
What
Fixes #2174 by making REST datetime responses explicit UTC values.
SQLite drops
tzinfowhen round-tripping SQLAlchemy datetime columns, so API responses such asstarted_atarrived as suffix-less ISO strings. Browsers then interpreted them as local time, making elapsed job timers start at the viewer’s UTC offset (or stay at zero west of UTC).Changes
UTCDateTimePydantic type for REST response schemas.Zsuffix.This covers the affected consumers called out in #2174: job elapsed/finished timestamps, repository timestamps, conversation age, dead-code timestamps, and git/ownership timestamps.
Tests
uv run ruff check packages/server/src/repowise/server/schemas tests/unit/server/test_datetime_serialization.pyuv run pytest tests/unit/server/test_datetime_serialization.py tests/unit/server/test_repos.py tests/unit/server/test_pages.py tests/unit/server/test_git.py tests/unit/server/test_chat_router.py tests/unit/server/test_decisions_api.py tests/unit/server/test_stats_contributors.py -q— 108 passeduv run pytest tests/unit/server --ignore=tests/unit/server/mcp -q— 1,391 passedThe full API contract remains backward-compatible for consumers that parse ISO-8601 timestamps; the only change is that UTC is now declared instead of being inferred as browser-local time.