mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
The four `process-deleted-*-cascade` helpers of `app.srepl.main` loaded every soft-deleted row of a table into memory (`db/exec!`) and ran `:delete-object` inline (`wrk/invoke!`), so they could not be used against production: `file` alone has 2.1M deleted rows. They now share a single `submit-deleted-cascade!` that reads the rows with a server-side cursor (`db/plan`, in a read-only transaction) and submits one task per row, so the work goes through the workers like any other task. The row id goes as `label` with `dedupe` on, and the helpers accept `:limit`, `:ids` and `:dry-run?` to run bounded batches. Public names and their zero-arity form are unchanged. Tests cover the task params, the row's own date (not `now`), the `limit`/`ids`/`dry-run?` options and that each helper reads its own table. AI-assisted-by: deepseek-v4.1-flash