feat(api): cause-centric processing operations for the activity dialog #1397
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/processing-operations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Generalizes
domain_reprocess_runs(V181) into a cause-centric processing-operation ledger so the activity dialog can show the ACTION that caused processing (upload, settings change, manual reprocess, ...) as a top-level entry instead of process types.cause(CHECK-constrained: upload / settings_change / manual_reprocess / domain_onboarding / backfill / scheduled / retry_failed / recluster / domain_reset),requested_by_user_id,label;domain_keynow nullable. Existing rows keep their meaning via themanual_reprocessdefault.ProcessingOperationService: begin/complete/recordCompleted/progress/finish with the supersede invariant generalized (domain causes supersede per owner+domain; non-domain per owner+cause+label; superseded → failed).UserDiscoveryServicedelegates through it; run-id addressing fixed for loop heartbeats./api/processing-summaryoperations now carry additivecause+causeLabelfields, keyreprocess:<domain>/op:<id>; ordering ranks scheduled rows below user-action causes (LIMIT 60 → rank → 10 → newest-first) so per-minute scheduler runs cannot crowd out user actions. Stale-running→failed (2h) and the 7d upload window unchanged. failedTotal stays 0 (TODO; per-op worker_jobs grouping is the historical CPU-spike shape, out of scope by design).Old web bundles and Android are unaffected (additive fields only; Android does not consume this endpoint).
Validation
./gradlew :apps:api:test— 2336 tests, 0 failures (incl. new ProcessingOperationServiceTest 6, extended ProcessingSummaryServiceTest 20, PeopleClusteringResetPostgresTest validating V181 on real Postgres + full Flyway chain)operations() now selects the cause columns: domain-scoped rows keep the legacy 'reprocess:<domain>' key and '<display name> reprocess' label, non-domain rows use 'op:<run id>' keys and carry the stored English label. New additive fields cause + causeLabel let the web render causes ('Upload von Bildern', 'Einstellung geändert: ...') instead of process types; old bundles keep working off the unchanged label field. Ordering: newest-first, but 'scheduled' rows rank below user-action causes during selection (fetch LIMIT 60 -> rank -> cut 10) so the per-minute scheduler cannot crowd user actions out. Stale-running->failed (2h), the synthesized upload batch, and the 7d window are unchanged. failedTotal stays 0 with a TODO: per-operation worker_jobs groupings are prohibitively expensive (the historical CPU-spike shape).