feat(api): one processing operation per upload session #1533

Merged
chris merged 1 commit from feat/upload-session-operations into main 2026-11-15 22:35:40 +01:00
Owner

Summary

Replaces the single aggregated upload-batch operation in /api/processing-summary with one operation per upload session (upload:<sessionId>). Top-level activity elements are now the user's concrete upload runs: a 300k-file backup = one card; a later restarted backup = a new card.

Changes

  • ProcessingSummary.Operation: new optional sessionId + lanes (per-session lane breakdown: finished/total/processing/failed per process type), both NON_NULL — reprocess ops keep today's JSON byte-for-byte
  • ProcessingSummaryService: aggregate upload-batch op removed; per-session ops use the exact legacy batch selection rule (notified watermark, 7-day window, cancelled/failed/expired excluded); newest 10 sessions, grouped lane queries (bounded)
  • processedTotal = terminal upload-file statuses (documented media-based approximation, same formula as the web session cards); finishedCount counts jobs (retries can exceed totalCount)
  • recentBatch kept for backward compatibility (old web builds)
  • Tests: 8 new per-session tests replace the aggregate test; full suite 2636 tests / 0 failures

Deployment note

Web consumes this contract in feat/activity-cards-vB. Contract is additive (old web ignores sessionId/lanes; new web falls back to legacy aggregate when absent) — atomic compose deploy, no coordination gap.

Part of the activity-feed redesign (design variant B, user-approved).

## Summary Replaces the single aggregated `upload-batch` operation in /api/processing-summary with **one operation per upload session** (`upload:<sessionId>`). Top-level activity elements are now the user's concrete upload runs: a 300k-file backup = one card; a later restarted backup = a new card. ## Changes - `ProcessingSummary.Operation`: new optional `sessionId` + `lanes` (per-session lane breakdown: finished/total/processing/failed per process type), both NON_NULL — reprocess ops keep today's JSON byte-for-byte - `ProcessingSummaryService`: aggregate `upload-batch` op removed; per-session ops use the exact legacy batch selection rule (notified watermark, 7-day window, cancelled/failed/expired excluded); newest 10 sessions, grouped lane queries (bounded) - `processedTotal` = terminal upload-file statuses (documented media-based approximation, same formula as the web session cards); `finishedCount` counts jobs (retries can exceed totalCount) - `recentBatch` kept for backward compatibility (old web builds) - Tests: 8 new per-session tests replace the aggregate test; full suite 2636 tests / 0 failures ## Deployment note Web consumes this contract in feat/activity-cards-vB. Contract is additive (old web ignores sessionId/lanes; new web falls back to legacy aggregate when absent) — atomic compose deploy, no coordination gap. Part of the activity-feed redesign (design variant B, user-approved).
feat(api): one processing-summary operation per upload session
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 3s
Build and Deploy / Smoke API and media worker (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 / Build Android CI image (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 / Android unit tests and debug APK (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 / Deploy review instance (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 9m51s
f9c0cdc974
Replace the aggregate 'upload-batch' operation with one upload:<sessionId>
operation per recent upload session (same selection rule as the recent
batch: unnotified, receiving/committing/completed[_with_issues], 7d
window, >=1 committed media item; cancelled/expired/notified excluded —
the backend equivalent of the web's completed-session filter).

Upload operations carry a new optional sessionId (UUID string) and a
per-session lanes breakdown (same lane vocabulary as recentBatch; static
lanes from ProcessingActivityLanes + enabled discovery-domain lanes;
totalCount = session media count; finished counts jobs, not media).
enqueuedTotal = session media count; processedTotal is the documented
approximation via terminal upload_session_files statuses (committed/
processing_queued/preview_ready/skipped_duplicate — an exact
all-required-lanes-done predicate is not cheaply derivable); failedTotal
= the session's media's failed/expired/cancelled jobs (state 'failed' on
any failure). recentBatch stays for backward compat. sessionId/lanes are
@JsonInclude(NON_NULL) so reprocess operations keep today's JSON shape.

Contract consumed by a parallel web lane; deployment is atomic via one
compose deploy.
chris merged commit dc10e8020d into main 2026-11-15 22:35:40 +01: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!1533
No description provided.