Skip to content

Use timezone-aware Scan start defaults - #199

Merged
dextmorgn merged 1 commit into
reconurge:mainfrom
Ghraven:fix/scan-started-at-aware-utc
Jul 28, 2026
Merged

Use timezone-aware Scan start defaults#199
dextmorgn merged 1 commit into
reconurge:mainfrom
Ghraven:fix/scan-started-at-aware-utc

Conversation

@Ghraven

@Ghraven Ghraven commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the Scan.started_at datetime.utcnow default with a timezone-aware UTC timestamp
  • update the matching factory default so tests/builders create the same style of value

Problem

datetime.utcnow() returns a naive datetime object. The rest of this package already uses datetime.now(timezone.utc) in several timestamp paths, so Scan.started_at could be inconsistent with timezone-aware values.

Before / After

Before: newly-created Scan rows and ScanFactory instances received naive UTC datetimes.

After: both defaults produce timezone-aware UTC datetimes.

Verification

  • python -m py_compile flowsint-core/src/flowsint_core/core/models.py flowsint-core/tests/factories.py
  • $env:AUTH_SECRET='test-secret-for-local-pytest'; $env:REDIS_URL='redis://localhost:6379/0'; $env:MASTER_VAULT_KEY_V1='base64:qnHTmwYb+uoygIw9MsRMY22vS5YPchY+QOi/E79GAvM='; $env:NEO4J_URI_BOLT='bolt://127.0.0.1:7687'; $env:NEO4J_USERNAME='neo4j'; $env:NEO4J_PASSWORD='test-password'; uv run --package flowsint-core pytest flowsint-core/tests/services/test_timezone_timestamps.py flowsint-core/tests/repositories/test_scan_repository.py -q

@dextmorgn
dextmorgn merged commit a90e5e0 into reconurge:main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants