fix: monthly reset now updates reset_at correctly
All checks were successful
Deploy Development / deploy (push) Successful in 34s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s

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 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-20 13:14:35 +01:00
parent cd4d9124b0
commit 8415509f4c

View File

@ -318,8 +318,9 @@ def increment_feature_usage(profile_id: str, feature_id: str) -> None:
ON CONFLICT (profile_id, feature_id) ON CONFLICT (profile_id, feature_id)
DO UPDATE SET DO UPDATE SET
usage_count = user_feature_usage.usage_count + 1, usage_count = user_feature_usage.usage_count + 1,
reset_at = %s,
updated = CURRENT_TIMESTAMP updated = CURRENT_TIMESTAMP
""", (profile_id, feature_id, next_reset)) """, (profile_id, feature_id, next_reset, next_reset))
conn.commit() conn.commit()