From 499ca282e5042ea507c2413b18b7085e04702c08 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 28 Feb 2026 17:08:41 -0600 Subject: [PATCH] refac Co-Authored-By: Nil Puig <244631886+npuigm@users.noreply.github.com> --- .../versions/8452d01d26d7_add_chat_message_table.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py index c8a3647aec..567f7d673a 100644 --- a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py +++ b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py @@ -127,6 +127,11 @@ def upgrade() -> None: timestamp = message.get("timestamp", now) + try: + timestamp = int(float(timestamp)) + except Exception as e: + timestamp = now + # Normalize timestamp: convert ms to seconds, validate range if timestamp > 10_000_000_000: timestamp = timestamp // 1000