diff --git a/backend/src/app/binfile/v1.clj b/backend/src/app/binfile/v1.clj index 1e3a7b9176..207b40ec96 100644 --- a/backend/src/app/binfile/v1.clj +++ b/backend/src/app/binfile/v1.clj @@ -517,6 +517,15 @@ (update :object-id #(str/replace-first % #"^(.*?)/" (str file-id "/"))))) thumbnails)) +(defn- clean-features + [file] + (update file :features (fn [features] + (if (set? features) + (-> features + (cfeat/migrate-legacy-features) + (set/difference cfeat/backend-only-features)) + #{})))) + (defmethod read-section :v1/files [{:keys [::db/conn ::input ::project-id ::bfc/overwrite ::name] :as system}] @@ -527,6 +536,7 @@ file-id (:id file) file-id' (bfc/lookup-index file-id) + file (clean-features file) thumbnails (:thumbnails file)] (when (not= file-id expected-file-id)