From 8415509f4c1b2b594c1b63436c71ceacda0e967e Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 20 Mar 2026 13:14:35 +0100 Subject: [PATCH] fix: monthly reset now updates reset_at correctly Critical bug: usage limits were never resetting after first month because reset_at timestamp was not updated during ON CONFLICT UPDATE. This caused users to stay permanently blocked after reaching monthly limit once. Co-Authored-By: Claude Opus 4.6 --- backend/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/auth.py b/backend/auth.py index 21b0042..d170058 100644 --- a/backend/auth.py +++ b/backend/auth.py @@ -318,8 +318,9 @@ def increment_feature_usage(profile_id: str, feature_id: str) -> None: ON CONFLICT (profile_id, feature_id) DO UPDATE SET usage_count = user_feature_usage.usage_count + 1, + reset_at = %s, updated = CURRENT_TIMESTAMP - """, (profile_id, feature_id, next_reset)) + """, (profile_id, feature_id, next_reset, next_reset)) conn.commit()