Review app: https://staging-pr-359.mediagraph.io/login
Basic auth: staging / 2d34745ed4ef2761
App login: use any staging org admin account.
PR: https://github.com/mediagraph-io/mediagraph/pull/359
- Generalized bulk-job undo.
undo_bulk_job!now reverts Asset metadata, taggings, custom-meta values, collection/lightbox membership, and votes by walking PaperTrail versions tagged withbulk_job_id— not just storage-folder moves. - Stamping. Every PaperTrail version a bulk job produces is now tagged with its
bulk_job_id(viaAsset.with_bulk_jobat the job boundary + a thread-local fallback for child records). New partial indexversions(bulk_job_id) WHERE NOT NULL. - Vote + Asset tracking.
Voteis now PaperTrail-tracked. Asset's tracked-field list expanded (rating, has_people, nsfw_detected, submitted, model_release_status, captured_at, etc.). - Safety. New
:undoability (admins + global_content can undo any org bulk job; users can undo their own). 30-day undo horizon. Per-field "skip if changed since" — undo never clobbers a field the user edited after the bulk job ran. - Reports → Bulk Jobs UX. Summary column with details modal, asset-count modal, undo progress modal, "undone by X" stamp, and filters (date range / user / asset GUID).
- Explore → select 3–5 assets → Bulk Edit → set Description (overwrite) to
QA TEST DESC. Run it; wait for 100%. - Confirm the assets show
QA TEST DESC. - On the bulk-job completion notification, click Undo. A nested progress bar appears.
- ✅ Expected: descriptions revert to their original values; undo job reaches 100%.
- Bulk-add two keywords (
qa-kw-1,qa-kw-2) to a few assets. Undo.- ✅ Both keywords removed; pre-existing tags untouched.
- Bulk-remove an existing keyword from assets. Undo.
- ✅ The removed keyword is recreated on those assets.
- Bulk-set a Creator tag → Undo → ✅ original creator restored (or cleared if there was none).
- Bulk-set a custom meta field value → Undo → ✅ value removed.
- Bulk vote (thumbs up/down) on assets → Undo → ✅ vote reset.
- Bulk add assets to a Collection → Undo → ✅ assets removed from that Collection.
- Repeat for a Lightbox.
- Bulk delete (trash) a couple of disposable test assets → Undo → ✅ assets restored (un-trashed).
- Bulk-set Description =
BULK Aon an asset. Wait for completion. - Manually edit that asset's description to
MANUAL EDIT(single-asset edit, not bulk). - Undo the bulk job.
- ✅ Expected: description stays
MANUAL EDIT(NOT reverted to the pre-bulk value). The undo job's warnings list shows aSkipped description (modified after the original bulk job)entry.
- A bulk job older than 30 days: the Undo button is disabled in Reports → Bulk Jobs with an explanatory tooltip. (If you can age a record via console, the undo job records an
undo_too_oldwarning and finishes without reverting.)
- As a general (non-admin, non-content) user, attempt to undo a bulk job created by someone else (via the API or another user's job in Reports).
- ✅ Expected: 403 / "You do not have permission to undo this bulk job."
- As that same general user, undo your own bulk job → ✅ allowed.
- As admin or global_content, Reports → Bulk Jobs lists all org bulk jobs and Undo works on any.
URL: /<org-slug>/manage/reports/bulk-jobs
- Summary column: shows a one-line summary of what each job did. Click the ℹ︎ info icon → modal lists every operation, the user, status (colored tag), and undone-by info.
- Assets count: click the number → modal with a paginated thumb/filename/GUID table of that job's assets.
- Undo column:
- For an undoable processed job → Undo button; clicking opens a progress modal (same BulkJobProgress component as a normal in-flight job).
- After undo → shows
undone by <name> <time-ago>. - Job > 30 days old → button disabled with tooltip.
- Filters bar: date range picker, user select (type to search), asset-GUID search, Clear button. Each narrows the table; combining them ANDs.
- Undo job rows: an undo job's summary reads
Undo of bulk job #<N>: <original summary>; the details modal lists each reverted op prefixed with↩.
- Run a normal bulk edit end-to-end (no undo) → still works, progress bar + warnings behave as before.
- Meta Imports table (Reports) → asset-count modal still works (it now shares the same
JobAssetsTablecomponent).
- Only changes made after this code shipped are undoable. A bulk job run before the
bulk_job_idstamping existed has no tagged versions; undoing it surfaces aNo reversible changes were recorded for this bulk jobwarning and finishes cleanly (does not error). - Non-PaperTrail operations (AI/auto-tag, alt-text generation, face search, rotate, optimization requests, Frame.io sync) are not reverted — they're skipped, not errored.
- Undo runs as its own bulk job; large jobs revert in the same batched, progress-reported fashion as the original.
The review-app SSL 525 and the ES collection_paths fielddata 400 were environment bugs, already fixed:
- Cloudflare zone SSL was
full; staging origin is HTTP-only kamal-proxy. Added a scoped Configuration Rule:staging*.mediagraph.io→ SSL Flexible (prod is DNS-only, unaffected). bin/deploy-reviewnow clones the source index settings+mappings before_reindex(fix committed to master separately,74769d13).