hub (unreleased): review fix 1 — „told” is told at an address: a changed notification address is told again and waits again (the hole D84 exists for)

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 17:26:21 +01:00
1 parent cbfeeb626e
commit a6f4aa0b64
10 files changed
+412 -44

No files matched your search

@@ -0,0 +1,36 @@
# Review finding 1 — „told” survives a change of the household's notification address. The tests on the code BEFORE the fix:
--- FAIL: TestReview1_ToldDoesNotSurviveAnAddressChange (0.05s)
end_notice_review_test.go:204: after the address changed the row still says told: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-10-06 16:19:04 +0000 UTC ToldAt:2026-10-06 16:19:04 +0000 UTC ToldTo:household Tries:1 LastTry:2026-11-15 16:19:04 +0000 UTC LastReason: StuckTold:0001-01-01 00:00:00 +0000 UTC} — the hu
--- FAIL: TestReview1_BackAndForth_Removed_AndDuringTheSend (0.05s)
end_notice_review_test.go:252: round 1: the record says told, and the newest notice went to "customer@example.com" — the household's address is "intruder@example.net"
FAIL
FAIL gitea.dooplex.hu/admin/felhom-hub/internal/api 0.177s
FAIL
# After the fix, by mutation:
== MUTATION: a save that changes the address un-tells nothing (the writer)
RED on the mutant, GREEN on the real file
--- FAIL: TestReview1_ToldDoesNotSurviveAnAddressChange (0.05s)
end_notice_review_test.go:208: the save must un-tell the row itself: first named now (the operator's 3-day line counts from the change) and the reason on the row: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-10-06 16:21
--- FAIL: TestReview1_BackAndForth_Removed_AndDuringTheSend (0.05s)
end_notice_review_test.go:259: round 1: not told, and the reason is "the household's notification address changed after it was told — it is told again at the address it has now, and the 30 days start again"
1 mutations, 0 not a red-proof
== MUTATION: a row told at another address reads as told (the reader)
RED on the mutant, GREEN on the real file
--- FAIL: TestReview1_BackAndForth_Removed_AndDuringTheSend (0.16s)
end_notice_review_test.go:299: the mail went to the old address and the household counts as told: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 16:21:59 +0000 UTC ToldAt:2026-11-15 16:21:59 +0000 UTC ToldTo:househo
--- FAIL: TestReview1_ToldCountsOnlyAtTheAddressOnRecord (0.04s)
offsite_end_notice_test.go:222: the address on record is "intruder@example.net" and the row still reads told: {App:vikunja Press: FirstNamed:2026-10-01 10:00:00 +0000 UTC ToldAt:2026-10-01 10:00:00 +0000 UTC ToldTo:household Tries
== MUTATION: an address in other capitals or with spaces is another address
RED on the mutant, GREEN on the real file
--- FAIL: TestReview1_ASaveThatChangesNothingKeepsTheNotice (0.05s)
end_notice_review_test.go:232: a save that did not change the address ({"customer_id":"c1","email":" Customer@Example.COM ","enabled_events":[],"cooldown_hours":6,"source":"household"}) voided the notice or mailed again: {App:vik
--- FAIL: TestReview1_ToldCountsOnlyAtTheAddressOnRecord (0.04s)
offsite_end_notice_test.go:214: the same address in other capitals must be the same address: {App:vikunja Press: FirstNamed:2026-10-01 10:00:00 +0000 UTC ToldAt:0001-01-01 00:00:00 +0000 UTC ToldTo: Tries:1 LastTry:2026-10-01 10:0
== MUTATION: a household notice may be marked told with no address key
RED on the mutant, GREEN on the real file
--- FAIL: TestReview1_ToldCountsOnlyAtTheAddressOnRecord (0.04s)
offsite_end_notice_test.go:211: a household notice was marked told with no address key
3 mutations, 0 not a red-proof