hub (unreleased): a deleted box or household leaves no rows in the tables that had no delete; the delete journal stays (R-1376, D73)
gates / gates (push) Successful in 2m4s
gates / gates (push) Successful in 2m4s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
0ce752a370
commit
73d99d06c5
12 files changed
+440
-5
No files matched your search
@@ -1214,6 +1214,13 @@ func pruneAll(s *store.Store, maxDays int, logger *log.Logger) {
|
||||
} else if n > 0 {
|
||||
logger.Printf("[INFO] Pruned %d stale app issues", n)
|
||||
}
|
||||
// D73 (`09` §3 decision 293, R-1376): the rows a box or household deleted BEFORE this release left in the six
|
||||
// tables that had no delete. A delete now leaves none, so this finds something only once.
|
||||
if orphans, err := s.PurgeOrphanRows(); err != nil {
|
||||
logger.Printf("[ERROR] Purge rows of deleted boxes and households: %v", err)
|
||||
} else if orphans.Total() > 0 {
|
||||
logger.Printf("[INFO] Purged %d row(s) of boxes and households that no longer exist: %v", orphans.Total(), map[string]int64(orphans))
|
||||
}
|
||||
// R-901 (`09` §3 decision 181): a deleted customer's audit rows go 1 year after the deletion.
|
||||
if ev, nl, err := s.PruneDeletedCustomerAudit(time.Now().UTC(), store.DeletedCustomerAuditKeep); err != nil {
|
||||
logger.Printf("[ERROR] Prune deleted customers' audit rows: %v", err)
|
||||
|
||||
@@ -60,6 +60,8 @@ func TestR1383_MainWiresTheSilentFailureChecks(t *testing.T) {
|
||||
seen["lost-mail scan"]++
|
||||
case recv == "signedJobWaitChecker" && name == "Check":
|
||||
seen["signed-job sweep"]++
|
||||
case name == "PurgeOrphanRows" && fn.Name.Name == "pruneAll":
|
||||
seen["orphan sweep in the daily prune"]++ // D73, R-1376
|
||||
case recv == "endDateChecker" && name == "Check":
|
||||
seen["end-date sweep"]++ // R-1379
|
||||
}
|
||||
@@ -67,7 +69,7 @@ func TestR1383_MainWiresTheSilentFailureChecks(t *testing.T) {
|
||||
return true
|
||||
})
|
||||
}
|
||||
for _, k := range []string{"ledger built", `watched "deadline-check"`, `watched "offsite-key-audit"`, "lost-mail scan", "signed-job sweep", "end-date sweep"} {
|
||||
for _, k := range []string{"ledger built", `watched "deadline-check"`, `watched "offsite-key-audit"`, "lost-mail scan", "signed-job sweep", "end-date sweep", "orphan sweep in the daily prune"} {
|
||||
if seen[k] != 1 {
|
||||
t.Errorf("main.go: %s — found %d time(s), want 1", k, seen[k])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user