Auto: refactor/simplify-daily-limits #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/simplify-daily-limits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Automated PR for branch
refactor/simplify-daily-limits.Approved
Clean refactoring that replaces a complex token-based quota system (reserve/refund/monthly budgets) with a simple daily output message count. The changes are consistent across handlers, database, user management, strings, and tests. Logic is sound, tests are thorough, and the simplification significantly reduces complexity. No critical or warning-level issues found.
Suggestions
DAILY_MESSAGE_LIMIT_FREEandDAILY_MESSAGE_LIMIT_PREMIUMare defined in strings.py but never imported or referenced anywhere in the codebase. The actual limit-exceeded messages useTRANSLATION_LIMIT_EXCEEDED_FREEandTRANSLATION_LIMIT_EXCEEDED_PREMIUMinstead. Consider removing these unused strings or using them in place of theTRANSLATION_LIMIT_EXCEEDED_*variants.get_user_daily_output_messagessumsoutput_messagesacross ALL services (nois_translation_relatedorservice_namefilter). This means YouTube summaries or any other logged API calls also count toward the daily message limit. If this is intentional (unified daily cap), consider adding a brief comment to make that explicit.split_message()but before the message parts are actually sent to Telegram. If sending fails partway through, theoutput_messagescount will reflect intended parts rather than actually delivered ones. This is a very minor edge case and probably acceptable, but worth noting.