From 39cb4a081bac91a673af701ba379d98b1bc09ae2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 13 Feb 2024 10:46:09 +0100 Subject: [PATCH] :bug: Clean legacy features on binfile (v1) importation --- backend/src/app/binfile/v1.clj | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)