Fix DeleteExpired timezone mismatch with SQLite #93

Merged
qwc merged 1 commit from fix/session-delete-expired-timezone into main 2026-03-17 13:57:01 +01:00
Owner

Summary

  • DeleteExpired used SQL CURRENT_TIMESTAMP (UTC in SQLite) to compare against session expiry times stored via Go's time.Now() (local timezone)
  • On servers ahead of UTC, expired sessions were not being cleaned up because they appeared "in the future" relative to UTC
  • Fix: pass time.Now().UTC() as a query parameter instead of relying on CURRENT_TIMESTAMP

Test plan

  • TestSessionStoreDeleteExpired passes
  • Full test suite passes (368 tests)

🤖 Generated with Claude Code

## Summary - `DeleteExpired` used SQL `CURRENT_TIMESTAMP` (UTC in SQLite) to compare against session expiry times stored via Go's `time.Now()` (local timezone) - On servers ahead of UTC, expired sessions were not being cleaned up because they appeared "in the future" relative to UTC - Fix: pass `time.Now().UTC()` as a query parameter instead of relying on `CURRENT_TIMESTAMP` ## Test plan - [x] `TestSessionStoreDeleteExpired` passes - [x] Full test suite passes (368 tests) 🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Fix DeleteExpired timezone mismatch with SQLite
All checks were successful
CI / test (pull_request) Successful in 1m19s
CI / build (pull_request) Successful in 51s
CI / docker (pull_request) Has been skipped
42d0287207
CURRENT_TIMESTAMP is UTC in SQLite, but sessions are stored with
local time. Pass time.Now().UTC() as a parameter instead so the
comparison is consistent regardless of server timezone.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qwc merged commit 201ef0e088 into main 2026-03-17 13:57:01 +01:00
qwc deleted branch fix/session-delete-expired-timezone 2026-03-17 13:57:01 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/asiakirjat!93
No description provided.