[PR #149] [MERGED] Use timezone-aware UTC timestamps in core services #2848

Closed
opened 2026-06-13 06:27:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: mainHead: fix/timezone-aware-service-timestamps


📝 Commits (1)

  • b707961 fix: 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

  • Replaced datetime.utcnow() with datetime.now(timezone.utc) in the analysis, chat, and flow services.
  • Added focused service tests that assert newly created analyses, chats, and flows receive timezone-aware UTC timestamps.

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 for datetime.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.py

I could not run the focused pytest locally because this Windows environment does not have the project dependency environment installed (uv is unavailable and plain pytest import fails on missing passlib). 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.

## 📋 Pull Request Information **Original PR:** https://github.com/reconurge/flowsint/pull/149 **Author:** [@Ghraven](https://github.com/Ghraven) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@dextmorgn](https://github.com/dextmorgn) **Base:** `main` ← **Head:** `fix/timezone-aware-service-timestamps` --- ### 📝 Commits (1) - [`b707961`](https://github.com/reconurge/flowsint/commit/b707961e688a70df6d4fc1dfdd210d189dda27a2) fix: use timezone-aware service timestamps ### 📊 Changes **4 files changed** (+86 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 Description ## What changed - Replaced `datetime.utcnow()` with `datetime.now(timezone.utc)` in the analysis, chat, and flow services. - Added focused service tests that assert newly created analyses, chats, and flows receive timezone-aware UTC timestamps. ## 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 for `datetime.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.py` I could not run the focused pytest locally because this Windows environment does not have the project dependency environment installed (`uv` is unavailable and plain pytest import fails on missing `passlib`). Happy to adjust the tests if your CI shows anything I missed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-13 06:27:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/flowsint#2848