feat(api): processing operations (uploads + reprocess runs) in summary #974

Merged
chris merged 1 commit from feat/processing-operations-backend into main 2026-09-30 21:58:30 +02:00
Owner

What

Backend half of the activity dialog's Recent operations (pairs with #973, frozen contract):

  • Flyway V148: domain_reprocess_runs — one row per accepted reprocess trigger (owner, domain, mode, state, target_total, enqueued_total, timestamps) + owner/started_at index
  • UserDiscoveryService: persists run rows around the reworked enqueue loop — INSERT on trigger (prior running run of same owner+domain marked failed = superseded), per-chunk enqueued_total update, completed/failed transition on loop end; in-memory per-owner+domain guard untouched
  • ProcessingSummaryService.operations(ownerId): upload-batch operation (from the existing recent-batch window, totals summed across lanes, oldest unnotified session as startedAt) + last 10 reprocess runs with display_name LEFT-JOINed from discovery_domains; a 'running' row not updated for 2h (API died mid-run) maps to failed
  • ProcessingSummary.operations component: {key, label, kind, state, enqueuedTotal, processedTotal, failedTotal, startedAt, updatedAt}

Verification

  • Scoped suite (processing/discovery/upload/web-controller): 126 tests green, including 5 new cases — upload-batch operation shape, empty case, newest-first reprocess mapping, stale→failed, owner isolation
  • Full :apps:api:test: BUILD SUCCESSFUL (6m46s)
  • H2 fixtures updated in the three affected test schemas

Notes

  • Legacy lanes/badge/incompleteMedia logic unchanged; operations is additive
  • One more Testcontainers/integration check worth doing post-merge: Flyway V148 applies cleanly (plain CREATE TABLE + index, no data backfill)
  • Duplicate queued discovery jobs noted in ISSUE-077 are unrelated to this change

Merge with #973 (web) so contract + UI land in the same deployment; web is backward compatible either way.

## What Backend half of the activity dialog's **Recent operations** (pairs with #973, frozen contract): - **Flyway V148**: `domain_reprocess_runs` — one row per accepted reprocess trigger (owner, domain, mode, state, target_total, enqueued_total, timestamps) + owner/started_at index - **UserDiscoveryService**: persists run rows around the reworked enqueue loop — INSERT on trigger (prior running run of same owner+domain marked failed = superseded), per-chunk `enqueued_total` update, completed/failed transition on loop end; in-memory per-owner+domain guard untouched - **ProcessingSummaryService.operations(ownerId)**: upload-batch operation (from the existing recent-batch window, totals summed across lanes, oldest unnotified session as startedAt) + last 10 reprocess runs with display_name LEFT-JOINed from discovery_domains; a 'running' row not updated for 2h (API died mid-run) maps to failed - **ProcessingSummary.operations** component: `{key, label, kind, state, enqueuedTotal, processedTotal, failedTotal, startedAt, updatedAt}` ## Verification - Scoped suite (processing/discovery/upload/web-controller): 126 tests green, including 5 new cases — upload-batch operation shape, empty case, newest-first reprocess mapping, stale→failed, owner isolation - Full `:apps:api:test`: BUILD SUCCESSFUL (6m46s) - H2 fixtures updated in the three affected test schemas ## Notes - Legacy lanes/badge/incompleteMedia logic unchanged; `operations` is additive - One more Testcontainers/integration check worth doing post-merge: Flyway V148 applies cleanly (plain CREATE TABLE + index, no data backfill) - Duplicate queued discovery jobs noted in ISSUE-077 are unrelated to this change Merge with #973 (web) so contract + UI land in the same deployment; web is backward compatible either way.
feat(api): expose processing operations (uploads + reprocess runs) in summary
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 1m36s
38e4ae340a
Adds the backend half of the activity dialog's 'Recent operations':

- Flyway V148: domain_reprocess_runs table (one row per accepted
  reprocess trigger, with live enqueued progress)
- UserDiscoveryService persists run rows: insert on trigger (marking
  any prior running run of the same domain superseded/failed),
  per-chunk enqueued_total updates, completed/failed on loop end
- ProcessingSummaryService.operations(ownerId): upload-batch operation
  derived from the recent-batch window + last 10 reprocess runs with
  display names joined from discovery_domains; stale 'running' rows
  (no update for 2h, i.e. API died mid-run) map to failed
- ProcessingSummary gains the operations component (frozen contract
  with the web lane: key/label/kind/state/enqueuedTotal/processedTotal/
  failedTotal/startedAt/updatedAt)
- Tests: 5 new ProcessingSummaryServiceTest cases (upload-batch op,
  empty case, newest-first mapping, stale->failed, owner isolation);
  H2 fixtures in three test schemas gain the new table

The existing in-memory enqueue guard and legacy lanes/badge logic are
unchanged.
chris merged commit a34971f93a into main 2026-09-30 21:58:30 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!974
No description provided.