diff --git a/backend/src/app/binfile/common.clj b/backend/src/app/binfile/common.clj index 1f6ab99cf2..cf8508caa0 100644 --- a/backend/src/app/binfile/common.clj +++ b/backend/src/app/binfile/common.clj @@ -550,7 +550,7 @@ [cfg data file-id] (let [library-ids (get-libraries cfg [file-id])] (reduce (fn [data library-id] - (if-let [library (get-file cfg library-id)] + (if-let [library (get-file cfg library-id :include-deleted? true)] (ctf/absorb-assets data (:data library)) data)) data diff --git a/backend/src/app/binfile/v3.clj b/backend/src/app/binfile/v3.clj index 682ddc74de..cf88f71551 100644 --- a/backend/src/app/binfile/v3.clj +++ b/backend/src/app/binfile/v3.clj @@ -228,6 +228,7 @@ (db/tx-run! cfg (fn [cfg] (cond-> (bfc/get-file cfg file-id {:realize? true + :include-deleted? true :lock-for-update? true}) detach? (-> (ctf/detach-external-references file-id) @@ -285,14 +286,12 @@ (let [file (cond-> (select-keys file bfc/file-attrs) (:options data) - (assoc :options (:options data)) + (assoc :options (:options data))) - :always - (dissoc :data)) - - file (cond-> file - :always - (encode-file)) + file (-> file + (dissoc :data) + (dissoc :deleted-at) + (encode-file)) path (str "files/" file-id ".json")] (write-entry! output path file))