mirror of
https://github.com/reconurge/flowsint.git
synced 2026-07-17 01:24:19 -05:00
[PR #149] [MERGED] Use timezone-aware UTC timestamps in core services #3842
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/reconurge/flowsint/pull/149
Author: @Ghraven
Created: 5/30/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @dextmorgn
Base:
main← Head:fix/timezone-aware-service-timestamps📝 Commits (1)
b707961fix: use timezone-aware service timestamps📊 Changes
4 files changed (+86 additions, -14 deletions)
View changed files
📝
flowsint-core/src/flowsint_core/core/services/analysis_service.py(+4 -4)📝
flowsint-core/src/flowsint_core/core/services/chat_service.py(+6 -6)📝
flowsint-core/src/flowsint_core/core/services/flow_service.py(+4 -4)➕
flowsint-core/tests/services/test_timezone_timestamps.py(+72 -0)📄 Description
What changed
datetime.utcnow()withdatetime.now(timezone.utc)in the analysis, chat, and flow services.Why
The affected SQLAlchemy columns are declared as
DateTime(timezone=True), but the services were passing naive UTC datetimes. Using timezone-aware UTC values avoids ambiguity and follows the recommended replacement fordatetime.utcnow().Verification
python -m py_compile flowsint-core/src/flowsint_core/core/services/analysis_service.py flowsint-core/src/flowsint_core/core/services/chat_service.py flowsint-core/src/flowsint_core/core/services/flow_service.py flowsint-core/tests/services/test_timezone_timestamps.pyI could not run the focused pytest locally because this Windows environment does not have the project dependency environment installed (
uvis unavailable and plain pytest import fails on missingpasslib). Happy to adjust the tests if your CI shows anything I missed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.