Skip to content

fix(editor): send every crossed credit alert threshold - #309

Closed
Gabriele06-local wants to merge 1 commit into
eullm:mainfrom
Gabriele06-local:fix/credit-alert-jump
Closed

Gabriele06-local wants to merge 1 commit into
eullm:mainfrom
Gabriele06-local:fix/credit-alert-jump

Conversation

@Gabriele06-local

Copy link
Copy Markdown
Contributor

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.

@primoco primoco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@primoco primoco closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants