Thread a Media lifecycle status end-to-end (prefactor) #166
Labels
No labels
kind
bug
kind
enhancement
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/vernier#166
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Part of the "defer media processing to a background job" spec (PR #165; ADR-0020,
ADR-0021, and the CONTEXT.md Processing term). This is the prefactor slice —
"make the change easy, then make the easy change" — done before any deferral so the
later change is small.
What to build
Give Media a lifecycle status of Processing / Ready / Failed, threaded through
the aggregate, the
mediatable, and every read path — without changing anyobservable behavior yet.
Media creation still optimizes inline and records the Media as Ready. Existing
rows migrate to Ready. The read paths gate on status:
GET /media/{id}serves onlya Ready Media (404 otherwise), and the Post photo render and the RSS/Atom
feed-photo lookup include a Photo only when its Media is Ready — Processing and
Failed Media are omitted.
Because all media is Ready after this slice, nothing a user sees changes. The point
is that a Media that is not Ready is now correctly hidden, so the next slice can
create Processing media safely.
How the absent-until-Ready rendition data (
bytes,byte_size,width,height)is stored is an open schema decision — nullable columns, a separate rendition row
keyed by
MediaId, or values read only through the status. Pick one here; ADR-0020requires only that they are absent until Ready.
Acceptance criteria
mediaschema records status; a migration sets existing rows to Ready.create_mediarecords the new Media as Ready (behavior otherwise unchanged).GET /media/{id}returns 404 for a Processing or Failed Media and 200 for a Ready one.Blocked by
None - can start immediately.