hub (unreleased): the notice's texts — what to do if the household did not ask for it; the subject names the deletion and its day (decision 316, R-1374)
Household-facing, built and NOT published: the operator reads them before a release. Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
42ef25c23b
commit
9ef8cee1c4
13 files changed
+74
-17
No files matched your search
@@ -0,0 +1,28 @@
|
||||
== MUTATION: the mail does not say what to do if the household did not ask for it
|
||||
RED on the mutant, GREEN on the real file
|
||||
--- FAIL: TestNotice_ReachesTheHouseholdWhateverItsSwitches (0.05s)
|
||||
end_notice_test.go:65: the body lacks "\n\nHa ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a jelszavadat.\n\nHa kérdésed van":
|
||||
--- FAIL: TestNotice_FollowsTheHouseholdsLanguage (0.04s)
|
||||
end_notice_test.go:93: the English body lacks "\n\nIf you did not ask for this, take it back on the Backups page and change your password.\n\nIf you have any questions":
|
||||
|
||||
1 mutations, 0 not a red-proof
|
||||
== MUTATION: the subject is the frame's ("Information: … marked for deletion"), not the deletion and its day
|
||||
RED on the mutant, GREEN on the real file
|
||||
--- FAIL: TestNotice_ReachesTheHouseholdWhateverItsSwitches (0.05s)
|
||||
end_notice_test.go:60: the subject does not name the deletion and its day: "[Felhom] Információ: vikunja: a távoli másolatok törlésre kijelölve"
|
||||
--- FAIL: TestNotice_FollowsTheHouseholdsLanguage (0.05s)
|
||||
end_notice_test.go:88: not the English subject: "[Felhom] Information: vikunja: the off-site copies are marked for deletion"
|
||||
== MUTATION: one date form: an English household gets the Hungarian form
|
||||
RED on the mutant, GREEN on the real file
|
||||
--- FAIL: TestNotice_FollowsTheHouseholdsLanguage (0.04s)
|
||||
end_notice_test.go:88: not the English subject: "[Felhom] vikunja: the off-site copies will be deleted on 2026. 12. 15."
|
||||
--- FAIL: TestCustomerMailGoldens (0.01s)
|
||||
mail_golden_test.go:235: mail customer_shape_offsite_end_scheduled_receipt changed.
|
||||
== MUTATION: one date form: a Hungarian household gets a written month
|
||||
RED on the mutant, GREEN on the real file
|
||||
--- FAIL: TestNotice_ReachesTheHouseholdWhateverItsSwitches (0.04s)
|
||||
end_notice_test.go:60: the subject does not name the deletion and its day: "[Felhom] vikunja: a távoli másolatok törlésének napja: 2026. December 15."
|
||||
--- FAIL: TestCustomerMailGoldens (0.01s)
|
||||
mail_golden_test.go:235: mail customer_shape_offsite_end_scheduled_receipt changed.
|
||||
|
||||
3 mutations, 0 not a red-proof
|
||||
@@ -1,5 +1,16 @@
|
||||
## Unreleased (after v0.182.0)
|
||||
|
||||
- **The notice's texts (2026-11-15 evening, `09` §3 decision 316, R-1374; `07` §8.2f — household-facing, NOT
|
||||
published: the operator reads them before a release).** (1) The mail ends with what to do if the household did
|
||||
not ask for the deletion — „Ha ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a
|
||||
jelszavadat.” / "If you did not ask for this, take it back on the Backups page and change your password." — a
|
||||
paragraph of its own after the message line (`mail.receipt.offsite_end_scheduled.not_you`). (2) The subject names
|
||||
the deletion and its day, not „Információ”: „[Felhom] {app}: a távoli másolatok törlésének napja: {dátum}” /
|
||||
"[Felhom] {app}: the off-site copies will be deleted on {date}" (`….subject`; `FormatReceiptEmail` gives the
|
||||
receipt its own subject, the frame is not changed for any other mail). (3) One date form in the subject and the
|
||||
body: `2026. 12. 15.` / `2026-12-15`, the controller's `i18n.FormatDate`. Goldens
|
||||
`customer_shape_offsite_end_scheduled_receipt` (now rendered by `FormatReceiptEmail`, the path the hub sends by)
|
||||
and `customer_event_offsite_end_scheduled`, both languages; 4 mutations seen red.
|
||||
- **The notice lock (2026-11-15 evening, `09` §3 decision 315, R-1374; `07` §8.2f): no notice, no deletion.** The
|
||||
household's mail about „delete backup data” was sent once, from the box's event — a lost event, a failed send or
|
||||
the daily limit, and the hub still agreed 30 days later. Now **the hub sends the notice itself, from its own
|
||||
|
||||
@@ -162,11 +162,11 @@ func TestNotice_AReportNamesAnApp_TheHubMailsTheHouseholdOncePerPress(t *testing
|
||||
t.Fatalf("the household got %d notice(s) after the first report that names the app, want 1: %+v", len(got), r.all())
|
||||
}
|
||||
hubDay := time.Now().Add(offsitekeys.EndedAppAfter)
|
||||
if !strings.Contains(got[0].subject, "vikunja: ") || strings.Contains(got[0].subject+got[0].body, "1999") {
|
||||
if !strings.Contains(got[0].subject, "vikunja: a távoli másolatok törlésének napja: ") || strings.Contains(got[0].subject+got[0].body, "1999") {
|
||||
t.Fatalf("the notice must name the app and the HUB's day, never the box's ends_at:\n%s\n%s", got[0].subject, got[0].body)
|
||||
}
|
||||
if y := fmt.Sprintf("Törlésük napja: %d.", hubDay.Year()); !strings.Contains(got[0].body, y) {
|
||||
t.Fatalf("the mail's day is not the hub's clock + 30 days (%s): %s", y, got[0].body)
|
||||
if y := fmt.Sprintf("%d.", hubDay.Year()); !strings.Contains(got[0].subject, y) {
|
||||
t.Fatalf("the subject's day is not the hub's clock + 30 days (%s): %s", y, got[0].subject)
|
||||
}
|
||||
n, ok := r.notice("vikunja")
|
||||
if !ok || n.ToldTo != store.EndNoticeHousehold || n.ToldAt.Before(before) || n.ToldAt.After(time.Now().Add(time.Second)) {
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
"mail.event.app_stopped_unhealthy": "%s: the app was stopped because it kept crashing",
|
||||
"mail.event.offsite_end_scheduled": "%s: the off-site copies are marked for deletion",
|
||||
"mail.receipt.offsite_end_scheduled": "%s: the off-site copies of this app are marked for deletion. They are deleted on: %s. Until then you can take this back on the Backups page with the “Keep it after all” button.",
|
||||
"mail.receipt.offsite_end_scheduled.subject": "[Felhom] %s: the off-site copies will be deleted on %s",
|
||||
"mail.receipt.offsite_end_scheduled.not_you": "\n\nIf you did not ask for this, take it back on the Backups page and change your password.",
|
||||
"mail.event.app_held": "An app is stopped and waits for a person to act",
|
||||
"mail.event.app_hold_cleared": "The app is no longer held",
|
||||
"mail.event.app_held_reminder": "An app is still held",
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
"mail.event.app_stopped_unhealthy": "%s: az alkalmazást leállítottuk, mert újra és újra összeomlott",
|
||||
"mail.event.offsite_end_scheduled": "%s: a távoli másolatok törlésre kijelölve",
|
||||
"mail.receipt.offsite_end_scheduled": "%s: az alkalmazás távoli másolatai törlésre vannak kijelölve. Törlésük napja: %s Addig a Mentések oldalon a „Mégis megtartom” gombbal visszavonhatod.",
|
||||
"mail.receipt.offsite_end_scheduled.subject": "[Felhom] %s: a távoli másolatok törlésének napja: %s",
|
||||
"mail.receipt.offsite_end_scheduled.not_you": "\n\nHa ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a jelszavadat.",
|
||||
"mail.event.app_held": "Egy alkalmazás le van állítva, és emberi beavatkozásra vár",
|
||||
"mail.event.app_hold_cleared": "Az alkalmazás leállítása megszűnt",
|
||||
"mail.event.app_held_reminder": "Egy alkalmazás még mindig le van állítva",
|
||||
|
||||
@@ -65,7 +65,8 @@ func receiptDate(lang string, t time.Time) string {
|
||||
}
|
||||
|
||||
// FormatReceiptEmail is the receipt's whole text — the hub's own words, a checked app name and the hub's own day.
|
||||
// The household mail frame with the hub's sentence as the message line (FormatCustomerEmail).
|
||||
// The subject names the deletion and its day (`09` §3 decision 316); the body is the household mail frame with the
|
||||
// hub's sentence as the message line and the „if you did not ask for this” line after it (FormatCustomerEmail).
|
||||
func FormatReceiptEmail(lang, customerID, eventType, severity, app string, ends time.Time) (string, string) {
|
||||
b := i18n.Shared()
|
||||
lang = i18n.Normalize(lang)
|
||||
@@ -73,7 +74,8 @@ func FormatReceiptEmail(lang, customerID, eventType, severity, app string, ends
|
||||
sentence := b.Msgf(lang, "mail.receipt."+eventType, app, day)
|
||||
// The details the frame reads (the app for the headline) are rebuilt from the CHECKED value.
|
||||
det, _ := json.Marshal(map[string]string{"stack_name": app})
|
||||
return FormatCustomerEmail(lang, customerID, eventType, severity, sentence, "", string(det))
|
||||
_, body := FormatCustomerEmail(lang, customerID, eventType, severity, sentence, "", string(det))
|
||||
return b.Msgf(lang, "mail.receipt."+eventType+".subject", app, day), body
|
||||
}
|
||||
|
||||
// MailHeld reports whether the hub-wide mail hold is on (no mail of any kind goes out).
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// THE NOTICE LOCK, the mail's half (`09` §3 decisions 315 and 316; `07-backup-architecture.md` §8.2f). The household's
|
||||
// notice is sent by the hub from its own state (SendEndNotice, called by api.endNotices) — never from the box's event.
|
||||
// These tests replace TestD84_Receipt_* of the first build, whose mail left from the event.
|
||||
// RED-PROOFS: documentation/audits/build-release-4b-2026-11-15/A/redproof-notice-mail.txt.
|
||||
// RED-PROOFS: documentation/audits/build-release-4b-2026-11-15/A/redproof-notice-mail.txt and …/B/redproof-texts.txt.
|
||||
|
||||
type receiptMail struct{ to, subject, body string }
|
||||
|
||||
@@ -56,10 +56,11 @@ func TestNotice_ReachesTheHouseholdWhateverItsSwitches(t *testing.T) {
|
||||
if m.to != "customer@example.com" {
|
||||
t.Fatalf("the notice went to %q, not to the household's own address", m.to)
|
||||
}
|
||||
if !strings.Contains(m.subject, "vikunja: a távoli másolatok törlésre kijelölve") {
|
||||
t.Fatalf("the subject does not name the app: %q", m.subject)
|
||||
if m.subject != "[Felhom] vikunja: a távoli másolatok törlésének napja: 2026. 12. 15." {
|
||||
t.Fatalf("the subject does not name the deletion and its day: %q", m.subject)
|
||||
}
|
||||
for _, want := range []string{"Törlésük napja: 2026. 12. 15. Addig", "Mégis megtartom", "Mentések oldalon"} {
|
||||
for _, want := range []string{"Törlésük napja: 2026. 12. 15. Addig", "Mégis megtartom", "Mentések oldalon",
|
||||
"\n\nHa ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a jelszavadat.\n\nHa kérdésed van"} {
|
||||
if !strings.Contains(m.body, want) {
|
||||
t.Fatalf("the body lacks %q:\n%s", want, m.body)
|
||||
}
|
||||
@@ -83,15 +84,16 @@ func TestNotice_FollowsTheHouseholdsLanguage(t *testing.T) {
|
||||
t.Fatalf("outcome %s, mails %d", out, len(*mails))
|
||||
}
|
||||
m := (*mails)[0]
|
||||
if !strings.Contains(m.subject, "vikunja: the off-site copies are marked for deletion") {
|
||||
if m.subject != "[Felhom] vikunja: the off-site copies will be deleted on 2026-12-15" {
|
||||
t.Fatalf("not the English subject: %q", m.subject)
|
||||
}
|
||||
for _, want := range []string{"They are deleted on: 2026-12-15.", "Keep it after all"} {
|
||||
for _, want := range []string{"They are deleted on: 2026-12-15.", "Keep it after all",
|
||||
"\n\nIf you did not ask for this, take it back on the Backups page and change your password.\n\nIf you have any questions"} {
|
||||
if !strings.Contains(m.body, want) {
|
||||
t.Fatalf("the English body lacks %q:\n%s", want, m.body)
|
||||
}
|
||||
}
|
||||
if strings.Contains(m.body, "Mégis megtartom") {
|
||||
if strings.Contains(m.body, "Mégis megtartom") || strings.Contains(m.body, "nem te") {
|
||||
t.Fatalf("Hungarian in an English household's mail:\n%s", m.body)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func customerMailCases(lang string) []mailCase {
|
||||
},
|
||||
mailCase{
|
||||
name: "customer_shape_offsite_end_scheduled_receipt",
|
||||
comment: "D84 + decision 315: the household's notice as the hub sends it — the entry names the app, the hub's sentence is the line, no raw details",
|
||||
comment: "D84 + decisions 315/316: the household's notice as the hub sends it — its own subject (the deletion and its day), the hub's sentence as the line, the if-not-you line, no raw details",
|
||||
render: func() (string, string) {
|
||||
return FormatReceiptEmail(lang, "demo-fixture", "offsite_end_scheduled", "info", "vikunja", time.Date(2026, 12, 15, 12, 0, 0, 0, time.UTC))
|
||||
},
|
||||
|
||||
@@ -225,6 +225,8 @@ func FormatCustomerEmail(lang, customerID, eventType, severity, message, message
|
||||
body += b.Msg(lang, "mail.customer.line.health_dashboard")
|
||||
} else if householdReceiptEvents[eventType] {
|
||||
// D84: a receipt carries no raw details — the hub's own sentence says them in words (FormatReceiptEmail).
|
||||
// `09` §3 decision 316: it ends with what to do if the household did not ask for this — the mail's reason.
|
||||
body += b.Msg(lang, "mail.receipt."+eventType+".not_you")
|
||||
} else if detailsJSON != "" && detailsJSON != "{}" {
|
||||
body += b.Msgf(lang, "mail.customer.line.note", detailsJSON)
|
||||
}
|
||||
|
||||
+2
@@ -12,6 +12,8 @@ Details:
|
||||
- Level: Warning
|
||||
- Type: offsite_end_scheduled
|
||||
|
||||
If you did not ask for this, take it back on the Backups page and change your password.
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,5 @@
|
||||
# D84 + decision 315: the household's notice as the hub sends it — the entry names the app, the hub's sentence is the line, no raw details
|
||||
SUBJECT: [Felhom] Information: vikunja: the off-site copies are marked for deletion
|
||||
# D84 + decisions 315/316: the household's notice as the hub sends it — its own subject (the deletion and its day), the hub's sentence as the line, the if-not-you line, no raw details
|
||||
SUBJECT: [Felhom] vikunja: the off-site copies will be deleted on 2026-12-15
|
||||
---
|
||||
Dear Customer,
|
||||
|
||||
@@ -14,6 +14,8 @@ Details:
|
||||
- Type: offsite_end_scheduled
|
||||
- Message: vikunja: the off-site copies of this app are marked for deletion. They are deleted on: 2026-12-15. Until then you can take this back on the Backups page with the “Keep it after all” button.
|
||||
|
||||
If you did not ask for this, take it back on the Backups page and change your password.
|
||||
|
||||
If you have any questions, contact your operator.
|
||||
|
||||
Best regards,
|
||||
|
||||
+2
@@ -12,6 +12,8 @@ Részletek:
|
||||
- Szint: Figyelmeztetés
|
||||
- Típus: offsite_end_scheduled
|
||||
|
||||
Ha ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a jelszavadat.
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,5 @@
|
||||
# D84 + decision 315: the household's notice as the hub sends it — the entry names the app, the hub's sentence is the line, no raw details
|
||||
SUBJECT: [Felhom] Információ: vikunja: a távoli másolatok törlésre kijelölve
|
||||
# D84 + decisions 315/316: the household's notice as the hub sends it — its own subject (the deletion and its day), the hub's sentence as the line, the if-not-you line, no raw details
|
||||
SUBJECT: [Felhom] vikunja: a távoli másolatok törlésének napja: 2026. 12. 15.
|
||||
---
|
||||
Kedves Ügyfél!
|
||||
|
||||
@@ -14,6 +14,8 @@ Részletek:
|
||||
- Típus: offsite_end_scheduled
|
||||
- Üzenet: vikunja: az alkalmazás távoli másolatai törlésre vannak kijelölve. Törlésük napja: 2026. 12. 15. Addig a Mentések oldalon a „Mégis megtartom” gombbal visszavonhatod.
|
||||
|
||||
Ha ezt nem te kérted, vond vissza a Mentések oldalon, és változtasd meg a jelszavadat.
|
||||
|
||||
Ha kérdésed van, vedd fel a kapcsolatot az üzemeltetővel.
|
||||
|
||||
Üdvözlettel,
|
||||
|
||||
Reference in new issue
Block a user