Repository navigation
fix(editor): send every crossed credit alert threshold - #309
Closed
Gabriele06-local wants to merge 1 commit into
Closed
Gabriele06-local wants to merge 1 commit into
Gabriele06-local wants to merge 1 commit into
Conversation
primoco
reviewed
Nov 20, 2026
primoco
left a comment
Contributor
There was a problem hiding this comment.
Thanks, but we would rather keep the current behaviour here. When a single spend takes a newsroom from below 80% straight to 100%, this sends two emails in the same minute: "used 80% of the month's credits" and "credits finished". The first one is already out of date when it arrives, and its body even reports the full amount ("used 100 of the 100 credits") under an 80% subject, which is confusing. Sending only the highest threshold reached is intentional: the 100% email already says everything the owner needs. Closing this one.
Generated by Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alerts()chose only the highest crossed threshold, so a single spend jumping from 0 to 100% sent the 100% email but skipped the promised 80% notice. Every not-yet-sent threshold that was crossed is now reported and mailed; the stored marker still records only the highest reached level, so no alert is repeated in later rounds. Added a test for the two-threshold jump.Verification:
uv run pytest tests/test_credits.py -q— 9 passed, 9 skipped (PostgreSQL only).I have read and agree to the Contributor Licence Agreement in CLA.md.