diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1d3f6..a76dafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## v0.306.0 — the off-site note decides on its kind only; the pre-0.251.0 text fallback is gone (R-570) (2026-10-10) + +**MinAgent: 0.131.0** (unchanged — no agent call changed). Released 2026-10-10 alone (no hub change). + +- **R-570 — the legacy text fallback in `offboxWarningDisplay` is deleted** (`internal/web/handlers.go`), with its + constant `offboxStaleWarningMarker`. It existed only for a box whose last off-site run predated v0.251.0 and so + carried the „nincs mentésre jelölt alkalmazás" note without a KIND. The row's condition is met, read on each box's + own `settings.json` on 2026-10-10: demo-hp, demo-felhom and Tester 1 each have `offbox.last_success` + 2026-10-10 ~02:16Z on controller 0.304.0; Tester 2 was installed 2026-10-04 on a far newer controller. The page now + decides on `LastWarningKind` ONLY: the same words with no kind are shown verbatim. Red-proof: + `TestR553_StaleNoteDecisionSurvivesWordingChange`'s new row „no kind: the words alone decide nothing" FAILED against + the fallback (it returned the replacement) and passes without it. `TestR570SentenceStaysHungarian` is deleted (it + was named for this row and said so); `TestR240_ZeroSelectionRunDoesNotSaySuccess` no longer pins the words, only the + kind. The zero-selection note itself is unchanged and still Hungarian — localisation may now translate it. + ## v0.305.0 — check first, stop second (R-921); a household's clear deletes the hub's address (R-922, controller half) (2026-10-10) **MinAgent: 0.131.0** (unchanged — R-921 reads only `GET /backup/tiers` and `GET /backup/status?target=`, both served diff --git a/REUSE.md b/REUSE.md index f0cf166..e84670e 100644 --- a/REUSE.md +++ b/REUSE.md @@ -64,7 +64,7 @@ | `monitor.WarnKind*` + `HealthReport.addWarning` / `WarningKindAt` | controller/internal/monitor/healthcheck.go | `(text, kind string)` | a health warning whose PLACEMENT the dashboard decides | Internal only: `internal/report/builder.go` copies Status/Issues/Warnings, so kinds never reach the hub (pinned) | | `monitor.MsgRef` + `HealthReport.addWarningMsg` / `addIssue` / `WarningMsgAt` / `IssueMsgAt` | controller/internal/monitor/healthcheck.go | `MsgRef{Key, Args}` beside the wire text | a health warning/issue whose BANNER must follow the household's language (R-516 item 10) | The wire text (report health.*) stays byte-identical; `AlertManager.Refresh` renders the key and falls back to the text when Key is empty. Every issue goes through `addIssue` so the parallel slices cannot drift (pinned) | | `AlertManager.GetBannerAlerts(page, lang)` + `bannerShows` (R-906, 2026-10-08) | controller/internal/web/alerts.go | the layout banner's list for ONE page, capped AFTER the page filter | any page that fills `data["Alerts"]` (`baseData` does it for you) | `GetAlerts` keeps Inline and other pages' alerts (debug dump, placement tests) and must not feed a banner: its cap counted alerts the layout then dropped, so a page showed „+ 5 további figyelmeztetés" and nothing above it. `bannerShows` mirrors the layout's own filter (pinned: `TestR906_*`) | -| `settings.OffboxTarget.LastWarningKind` + `backup.OffboxWarnNoAppsSelected` | controller/internal/settings/settings.go | persisted string | the Távoli mentés page's stale-note substitution | Written and cleared with `LastWarning`; the text fallback in `offboxWarningDisplay` is LEGACY only (kind == "") and is removed when R-570 closes | +| `settings.OffboxTarget.LastWarningKind` + `backup.OffboxWarnNoAppsSelected` | controller/internal/settings/settings.go | persisted string | the Távoli mentés page's stale-note substitution | Written and cleared with `LastWarning`; the page decides on the kind ONLY — the legacy text fallback was removed when R-570 closed (2026-10-10) | ### HTTP/JSON envelopes + flash messages diff --git a/controller/README.md b/controller/README.md index f29a6f9..00530b6 100644 --- a/controller/README.md +++ b/controller/README.md @@ -4007,7 +4007,7 @@ run SAVES follow the language as well, and the switch is a **globe** — on the sign-in, claim and recovery pages. Since **v0.257.0** the app catalog's own copy follows it, and since **v0.258.0/v0.259.0** so do the last Go-composed sentences: the update and lifecycle badges, the data-folder promise, the channel banners, **the claim page's nine answers (R-596)** and **the Backup -page's protection warnings and tier names (R-598)**. Still Hungarian: the one R-570 producer, the 18 +page's protection warnings and tier names (R-598)**. Still Hungarian: the zero-selection off-site note (no reader depends on its words since R-570 closed, 2026-10-10; not yet translated), the 18 formal „ön" forms (counted and ratcheted, R-516), **everything the operator reads** (by design), and the apps' own UIs (not ours). diff --git a/controller/internal/backup/offbox.go b/controller/internal/backup/offbox.go index 1c27ce4..81858ca 100644 --- a/controller/internal/backup/offbox.go +++ b/controller/internal/backup/offbox.go @@ -1186,9 +1186,9 @@ func (m *Manager) runOffboxBackup(ctx context.Context, withProgress bool) error // must not be told "nothing is selected". // R-240: the sentence no longer opens with „Sikeres" — a run that covered nothing was // congratulating the household on it. The verdict stays `ok` (an unconfigured selection is - // not a failure). Still a Hungarian LITERAL and still carrying the lowercase marker - // „nincs mentésre jelölt alkalmazás" (R-570: boxes with the older persisted text are - // recognised by those words). Pinned by TestR240_ZeroSelectionRunDoesNotSaySuccess. + // not a failure). Still a Hungarian LITERAL; since R-570 closed (2026-10-10) no reader depends + // on its words — the page decides on warnKind — so localisation may translate it. + // Pinned by TestR240_ZeroSelectionRunDoesNotSaySuccess. if len(apps) == 0 && !runResult.sharesBackedUp { warns = append(warns, "Ez a futás semmit nem mentett: nincs mentésre jelölt alkalmazás") warnKind = OffboxWarnNoAppsSelected // R-553: the page reads this, not the sentence diff --git a/controller/internal/backup/offsite_diag_test.go b/controller/internal/backup/offsite_diag_test.go index 6ceb81f..5291c1b 100644 --- a/controller/internal/backup/offsite_diag_test.go +++ b/controller/internal/backup/offsite_diag_test.go @@ -156,37 +156,6 @@ func backupNoteHU(t *testing.T, key string) string { return newNoteManager(t).note(key) } -// TestR570SentenceStaysHungarian — the ONE saved note release C may not translate. -// -// A box upgraded to 0.251.0 carries the OLD persisted warning with no kind until its next off-site -// run rewrites it, so `offboxWarningDisplay` still falls back to a substring test on those words when -// the kind is empty (R-553's documented exception). Translating the PRODUCER while that fallback is -// load-bearing would strand exactly the boxes the fallback exists for: their stale note would stop -// being recognised and would keep telling a household that nothing is covered. -// -// **Delete this test when R-570 closes** — it is named for the row on purpose. -// -// RED-PROOF (REPORT): turn the producer into m.note("…") → this test fails naming the line. -func TestR570SentenceStaysHungarian(t *testing.T) { - const sentence = "Ez a futás semmit nem mentett: nincs mentésre jelölt alkalmazás" - src, err := os.ReadFile("offbox.go") - if err != nil { - t.Fatal(err) - } - if !strings.Contains(string(src), `"`+sentence+`"`) { - t.Errorf("the R-570 producer no longer writes %q as a literal — a box that has not run off-site "+ - "since 0.251.0 carries that exact text with no kind, and offboxWarningDisplay finds it by "+ - "those words. Translating it strands them. Close R-570 first.", sentence) - } - // And the sentence must not have quietly acquired a bundle key either: a key would render - // Hungarian today and something else the day someone adds a translation. - for _, k := range []string{"note.offsite.no_apps_selected", "note.offsite.zero_toggle"} { - if strings.Contains(string(src), k) { - t.Errorf("the R-570 producer now names a bundle key (%s) — same problem, one step further away", k) - } - } -} - // TestNoteHelpersAreNotCalledUnderTheSettingsLock — release C (R-557), and it is a REGRESSION test, // not a precaution. // diff --git a/controller/internal/backup/r240_zero_selection_test.go b/controller/internal/backup/r240_zero_selection_test.go index 30c61de..4cc30f6 100644 --- a/controller/internal/backup/r240_zero_selection_test.go +++ b/controller/internal/backup/r240_zero_selection_test.go @@ -10,7 +10,7 @@ import ( // SUCCESSFUL right beside NOTHING SELECTED, the same shape as R-203/R-234 (a warning beside a success // is read as a success). The consequence asserted through the real run: the verdict stays `ok` (an // empty selection is not a failure), the note says plainly that the run saved nothing, it does NOT -// say „Sikeres", and it still carries the lowercase marker the R-570 legacy fallback reads. +// say „Sikeres", and it records its KIND (the page decides on the kind; R-570 removed the text fallback). func TestR240_ZeroSelectionRunDoesNotSaySuccess(t *testing.T) { m, sett := newOffboxManager(t) m.SetOffboxRunner(func(_ context.Context, _ []string, args ...string) ([]byte, error) { @@ -32,9 +32,6 @@ func TestR240_ZeroSelectionRunDoesNotSaySuccess(t *testing.T) { if !strings.Contains(st.LastWarning, "semmit nem mentett") { t.Errorf("R-240: the note does not say the run saved nothing: %q", st.LastWarning) } - if !strings.Contains(st.LastWarning, "nincs mentésre jelölt alkalmazás") { - t.Errorf("the R-570 marker is gone from the note: %q", st.LastWarning) - } if st.LastWarningKind != OffboxWarnNoAppsSelected { t.Errorf("the kind is not recorded: %q", st.LastWarningKind) } diff --git a/controller/internal/web/handlers.go b/controller/internal/web/handlers.go index 98e2ed7..7c9521c 100644 --- a/controller/internal/web/handlers.go +++ b/controller/internal/web/handlers.go @@ -1055,13 +1055,7 @@ func (s *Server) backupsOffboxData(data map[string]interface{}, lang string) { } } -// offboxStaleWarningMarker is the substring the zero-toggled offbox run wrote into LastWarning before -// v0.251.0, when the run started recording a KIND beside it (R-553). It is kept ONLY to read boxes -// upgraded with that older text already persisted — see offboxWarningDisplay. -const ( - offboxStaleWarningMarker = "nincs mentésre jelölt alkalmazás" - offboxSelectionChangedKey = "offbox.selection_changed" -) +const offboxSelectionChangedKey = "offbox.selection_changed" // offboxWarningDisplay picks what the Távoli mentés page shows for the persisted // Offbox.LastWarning. A zero-toggled run records "Sikeres — nincs mentésre jelölt @@ -1069,13 +1063,10 @@ const ( // replace it with the honest "selection changed, the next run covers it" note. // Pure display logic: the persisted LastWarning is never touched, and every other // warning (quota, partial failure) passes through verbatim. -// R-553 — the decision is made on the KIND the run recorded, not on the words of the sentence. -// The one text test that remains runs ONLY when there is no kind, i.e. on a box whose last off-site -// run happened before v0.251.0 and whose persisted warning therefore predates kinds. -// -// R-553 legacy: remove after every fleet box has completed one off-site run on ≥ 0.251.0 (row R-570). -// Localisation slice 2 (R-557) must not translate the producer at backup/offbox.go until that row is -// closed — translating it while this fallback is still needed would strand exactly those boxes. +// R-553 — the decision is made on the KIND the run recorded, never on the words of the sentence. +// R-570 (2026-10-10): the legacy text test for pre-0.251.0 warnings is removed — every fleet box has +// completed an off-site run on ≥ 0.251.0, so every persisted warning carries its kind. Pinned by +// TestR553_StaleNoteDecisionSurvivesWordingChange (no kind → verbatim). func (s *Server) offboxWarningDisplay(lastWarning, kind string, toggledCount int, lang string) string { if toggledCount < 1 { return lastWarning @@ -1083,9 +1074,6 @@ func (s *Server) offboxWarningDisplay(lastWarning, kind string, toggledCount int if kind == backup.OffboxWarnNoAppsSelected { return s.msgLang(lang, offboxSelectionChangedKey) } - if kind == "" && strings.Contains(lastWarning, offboxStaleWarningMarker) { - return s.msgLang(lang, offboxSelectionChangedKey) - } return lastWarning } diff --git a/controller/internal/web/offbox_warning_display_test.go b/controller/internal/web/offbox_warning_display_test.go index cc1f197..4796d5c 100644 --- a/controller/internal/web/offbox_warning_display_test.go +++ b/controller/internal/web/offbox_warning_display_test.go @@ -4,6 +4,7 @@ import ( "strings" "testing" + "gitea.dooplex.hu/admin/felhom-controller/internal/backup" "gitea.dooplex.hu/admin/felhom-controller/internal/settings" ) @@ -13,8 +14,8 @@ import ( // COMPANION red-proof (recorded in REPORT): make offboxWarningDisplay return lastWarning // unconditionally → TestOffboxWarningDisplay_Pick's 1-enabled case FAILS. // -// R-553 (v0.251.0): these calls pass an EMPTY kind on purpose — they are now the LEGACY path, a box -// whose last off-site run predates kinds. The kind path is TestR553_StaleNoteDecisionSurvivesWordingChange. +// R-570 (2026-10-10): the legacy no-kind path is gone; these calls carry the kind the run records. The +// no-kind contract (verbatim) is pinned by TestR553_StaleNoteDecisionSurvivesWordingChange. const staleZeroToggleWarning = "Sikeres — nincs mentésre jelölt alkalmazás volt a futáskor." @@ -22,11 +23,11 @@ func TestOffboxWarningDisplay_Pick(t *testing.T) { s, _, _ := newOffboxWebServer(t) selectionChanged := s.msgLang("hu", offboxSelectionChangedKey) // warning + ≥1 enabled → the replacement line - if got := s.offboxWarningDisplay(staleZeroToggleWarning, "", 1, "hu"); got != selectionChanged { + if got := s.offboxWarningDisplay(staleZeroToggleWarning, backup.OffboxWarnNoAppsSelected, 1, "hu"); got != selectionChanged { t.Errorf("stale warning + 1 toggled: got %q, want the selection-changed line", got) } // warning + 0 enabled → the original line, verbatim (the v0.123.0 honesty stays) - if got := s.offboxWarningDisplay(staleZeroToggleWarning, "", 0, "hu"); got != staleZeroToggleWarning { + if got := s.offboxWarningDisplay(staleZeroToggleWarning, backup.OffboxWarnNoAppsSelected, 0, "hu"); got != staleZeroToggleWarning { t.Errorf("stale warning + 0 toggled: got %q, want the original warning unchanged", got) } // any OTHER warning passes through regardless of toggles (quota, partial failure) @@ -47,9 +48,9 @@ func TestOffboxWarningDisplay_RemotePageRender(t *testing.T) { data := appRowSplitData() data["Offbox"] = &settings.OffboxTarget{ Enabled: true, Host: "nas.local", LastStatus: "ok", EscrowState: "escrowed", - LastWarning: staleZeroToggleWarning, + LastWarning: staleZeroToggleWarning, LastWarningKind: backup.OffboxWarnNoAppsSelected, } - data["OffboxWarningDisplay"] = s.offboxWarningDisplay(staleZeroToggleWarning, "", 1, "hu") + data["OffboxWarningDisplay"] = s.offboxWarningDisplay(staleZeroToggleWarning, backup.OffboxWarnNoAppsSelected, 1, "hu") html := renderBackupPage(t, "backups_remote", data) if !strings.Contains(html, selectionChanged) { t.Error("selection-changed note missing with 1 app toggled") @@ -64,9 +65,9 @@ func TestOffboxWarningDisplay_RemotePageRender(t *testing.T) { data["OffboxToggledCount"] = 0 data["Offbox"] = &settings.OffboxTarget{ Enabled: true, Host: "nas.local", LastStatus: "ok", EscrowState: "escrowed", - LastWarning: staleZeroToggleWarning, + LastWarning: staleZeroToggleWarning, LastWarningKind: backup.OffboxWarnNoAppsSelected, } - data["OffboxWarningDisplay"] = s.offboxWarningDisplay(staleZeroToggleWarning, "", 0, "hu") + data["OffboxWarningDisplay"] = s.offboxWarningDisplay(staleZeroToggleWarning, backup.OffboxWarnNoAppsSelected, 0, "hu") html = renderBackupPage(t, "backups_remote", data) if !strings.Contains(html, staleZeroToggleWarning) { t.Error("0 toggled: the original run warning must render unchanged") diff --git a/controller/internal/web/r553_stale_note_test.go b/controller/internal/web/r553_stale_note_test.go index 12f91e7..694bc7e 100644 --- a/controller/internal/web/r553_stale_note_test.go +++ b/controller/internal/web/r553_stale_note_test.go @@ -35,10 +35,12 @@ func TestR553_StaleNoteDecisionSurvivesWordingChange(t *testing.T) { {"still nothing selected → the honest note stays", hu, backup.OffboxWarnNoAppsSelected, 0, hu}, {"a quota note passes through", "A tároló a keret 84%-át használja (42/50 GB).", "", 3, "A tároló a keret 84%-át használja (42/50 GB)."}, - // LEGACY: a box upgraded to v0.251.0 still carries the OLD text with no kind until its next - // off-site run rewrites it. Until then the text test is what it has. - {"legacy persisted text, no kind", hu, "", 1, selectionChanged}, - {"legacy: any other text without a kind is shown verbatim", "Valami más történt.", "", 1, "Valami más történt."}, + // R-570 (2026-10-10): the legacy text test is GONE. Every fleet box ran off-site on ≥ 0.251.0 (read on + // demo-hp, demo-felhom and Tester 1: last_success 2026-10-10 ~02:16Z, controller 0.304.0), so no box carries + // the old text without a kind. The decision is the kind and ONLY the kind: the same words with no kind are + // shown verbatim — the words never decide again (red against the fallback: it returned the replacement). + {"no kind: the words alone decide nothing", hu, "", 1, hu}, + {"no kind: any other text is shown verbatim", "Valami más történt.", "", 1, "Valami más történt."}, } for _, c := range cases { if got := s.offboxWarningDisplay(c.warning, c.kind, c.toggled, "hu"); got != c.want {