v0.204.0 — the restore list is keyed on the store (R-237); the size gate stops refusing in silence (R-238)
gates / gates (push) Successful in 26s
gates / gates (push) Successful in 26s
R-237: /backups/restore listed apps that are CURRENTLY DEPLOYED and CURRENTLY TOGGLED ON for future off-site backups. A rebuilt box has neither, so a household that had just lost everything was shown nothing to restore while the repository held their snapshots — measured live on the R-201 re-walk. To restore an app you had to select it, to select it you had to have installed it, and to know what to install you had to see the backup you could not see. The store is now the source of the list (offsite_restore_list.go), built on the existing R-193 OffsiteInventoryList. Installed-ness became a property OF a row, never a filter on it. Every case is answered rather than hidden: a snapshot for an app that is not installed is offered and says it will reinstall first; an installed app with no snapshot is shown as having nothing; an unreadable store renders as UNKNOWN (R-225's rule, one screen over) AND keeps the action, because "we could not look" is not "there is nothing"; no-target is its own state. The felhom-offbox and _shares marker tags are excluded from the app list. R-238 classified as a HARNESS ARTIFACT: mode=full without confirm=1 is step 1 of a deliberate two-step — it starts no job by design and redirects carrying &full_prep=<app>, which deriveWizardStep requires to reveal the commit. A driver that did not carry it forward landed back on the intent step. The operator's browser run completed the same restore. The wizard's precedence rules were NOT re-keyed: a stale ?full_prep= must never resurrect a commit button mid-restore. The residue WAS real and is fixed: neither branch of that step wrote anything to the log, so a refusal — including by the headroom gate — left no trace on the box. Both branches now log, and so does the concurrent-op refusal. resolveWizardApp is removed: it was dead once the gate moved, and its test pinned the defect's behaviour (an untoggled app refused), which would have read as policy. 28 packages ok, 9/9 gates OK. Three red-proofs, each asserted to have applied.
This commit is contained in:
@@ -113,23 +113,30 @@ func TestDeriveWizardStep_Table(t *testing.T) {
|
||||
|
||||
// --- Group C (Scenario B error rows): refusals resolve, never 500 ----------------------------------
|
||||
|
||||
func TestResolveWizardApp_Refusals(t *testing.T) {
|
||||
rows := []OffboxAppRow{
|
||||
{Name: "immich", DisplayName: "Immich", Enabled: true},
|
||||
{Name: "radarr", DisplayName: "Radarr", Enabled: false},
|
||||
func TestResolveOffsiteRestoreApp_Refusals(t *testing.T) {
|
||||
// R-237 replaced the toggle gate with a store gate. The row that used to be refused for being
|
||||
// untoggled (radarr) now resolves when the STORE holds it — that reversal IS the fix.
|
||||
rows := []OffsiteRestoreRow{
|
||||
{App: "immich", DisplayName: "Immich", InStore: true, Enabled: true},
|
||||
{App: "radarr", DisplayName: "Radarr", InStore: true, Enabled: false},
|
||||
{App: "bookstack", DisplayName: "BookStack", Installed: true},
|
||||
}
|
||||
if got := resolveWizardApp(rows, "immich"); got == nil || got.DisplayName != "Immich" {
|
||||
t.Fatalf("toggled app must resolve, got %+v", got)
|
||||
if got := resolveOffsiteRestoreApp(rows, "immich"); got == nil || got.DisplayName != "Immich" {
|
||||
t.Fatalf("a stored app must resolve, got %+v", got)
|
||||
}
|
||||
if got := resolveWizardApp(rows, "radarr"); got != nil {
|
||||
t.Errorf("an app that is NOT toggled for offsite has no snapshot to restore from — want nil, got %+v", got)
|
||||
if got := resolveOffsiteRestoreApp(rows, "radarr"); got == nil {
|
||||
t.Errorf("the offsite TOGGLE must not gate a PAST backup — want resolved, got nil")
|
||||
}
|
||||
if got := resolveWizardApp(rows, "does-not-exist"); got != nil {
|
||||
if got := resolveOffsiteRestoreApp(rows, "bookstack"); got != nil {
|
||||
t.Errorf("an app with nothing in the store has no restore to offer — want nil, got %+v", got)
|
||||
}
|
||||
if got := resolveOffsiteRestoreApp(rows, "does-not-exist"); got != nil {
|
||||
t.Errorf("unknown app must not resolve, got %+v", got)
|
||||
}
|
||||
if got := resolveWizardApp(nil, "immich"); got != nil {
|
||||
if got := resolveOffsiteRestoreApp(nil, "immich"); got != nil {
|
||||
t.Errorf("empty set must not resolve, got %+v", got)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// The customer-visible URL must redirect, not 500, when the offsite target is not configured at all.
|
||||
|
||||
Reference in New Issue
Block a user