Skip to content

fix(dsp): make session created_at timezone-aware (UTC)#12

Open
CV-GPhL wants to merge 1 commit into
wwPDB:developfrom
CV-GPhL:fix/session-created-at-tz-aware
Open

fix(dsp): make session created_at timezone-aware (UTC)#12
CV-GPhL wants to merge 1 commit into
wwPDB:developfrom
CV-GPhL:fix/session-created-at-tz-aware

Conversation

@CV-GPhL

@CV-GPhL CV-GPhL commented Jun 22, 2026

Copy link
Copy Markdown

Problem

deposit_init (src/onedep_lib/dsp.py) sets created_at=datetime.now()
(naive) while add_file sets file_mtime with tz=timezone.utc (aware), and
json_store enforces tz-awareness only for file_mtime. Mixing naive and aware
datetimes risks TypeError on comparison and ambiguous serialization.

Fix

Use datetime.now(tz=timezone.utc) for created_at (timezone is already
imported).

Test

Adds a tz-aware assertion for the created session to
tests/unit/test_deposition_facade.py. Full suite green (144 passed).

deposit_init set created_at with a naive datetime.now() while file_mtime is
tz-aware (timezone.utc); json_store enforces awareness only for file_mtime.
Mixing naive and aware datetimes risks TypeError on comparison. Use
datetime.now(tz=timezone.utc).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant