This commit is contained in:
Timothy Jaeryang Baek
2026-02-02 08:55:13 -06:00
parent b2c2f1bd49
commit c22bb4f853
2 changed files with 36 additions and 6 deletions
@@ -124,6 +124,13 @@ def upgrade() -> None:
timestamp = message.get("timestamp", now)
# Normalize timestamp: convert ms to seconds, validate range
if timestamp > 10_000_000_000:
timestamp = timestamp // 1000
# Must be after 2020 and not too far in the future
if timestamp < 1577836800 or timestamp > now + 86400:
timestamp = now
try:
conn.execute(
sa.insert(chat_message_table).values(