hub (unreleased): review fix 2 — the notice's daily limit counts failed tries too, and the wait between tries doubles (a send that errors after it was accepted)

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 17:14:23 +01:00
1 parent 508f936ad4
commit b391a2322c
9 files changed
+146 -18

No files matched your search

@@ -0,0 +1,36 @@
# Review finding 2 — a send that errors after it was accepted is mailed every hour, outside the daily limit. The test on the code BEFORE the fix:
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour (0.11s)
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour/the_household's_notice (0.06s)
end_notice_review_test.go:123: 12 hours of a send that errors after it was accepted: 12 mails, want at most 4 (tries at 0, 1, 3 and 7 hours)
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour/the_operator's_in-place_notice (0.06s)
end_notice_review_test.go:123: 12 hours of a send that errors after it was accepted: 12 mails, want at most 4 (tries at 0, 1, 3 and 7 hours)
FAIL
FAIL gitea.dooplex.hu/admin/felhom-hub/internal/api 0.134s
FAIL
# After the fix, by mutation:
== MUTATION: the wait does not grow with the tries
RED on the mutant, GREEN on the real file
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour (0.10s)
end_notice_review_test.go:123: 12 hours of a send that errors after it was accepted: 5 mails, want at most 4 (tries at 0, 1, 3 and 7 hours)
end_notice_review_test.go:123: 12 hours of a send that errors after it was accepted: 5 mails, want at most 4 (tries at 0, 1, 3 and 7 hours)
== MUTATION: the operator's daily limit counts only sent mails
RED on the mutant, GREEN on the real file
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour (0.12s)
end_notice_review_test.go:129: four days of it: 8 mails — the daily limit must count a try that failed (all of them are inside this test's real 24 hours)
--- FAIL: TestNotice_NoAddress_ABoxCannotFloodTheOperator (0.29s)
end_notice_test.go:543: 101 presses in a day mailed the operator 51 times, want the household's daily limit 5
2 mutations, 0 not a red-proof
== MUTATION: the household's daily limit counts only sent mails
RED on the mutant, GREEN on the real file
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour (0.12s)
end_notice_review_test.go:129: four days of it: 8 mails — the daily limit must count a try that failed (all of them are inside this test's real 24 hours)
1 mutations, 0 not a red-proof
== MUTATION: the operator's daily limit counts only sent mails (the query)
RED on the mutant, GREEN on the real file
--- FAIL: TestReview2_ASendThatErrorsAfterItWasAcceptedIsNotMailedEveryHour (0.12s)
end_notice_review_test.go:129: four days of it: 8 mails — the daily limit must count a try that failed (all of them are inside this test's real 24 hours)
1 mutations, 0 not a red-proof