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
@@ -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