diff --git a/backend/src/app/rpc/commands/binfile.clj b/backend/src/app/rpc/commands/binfile.clj index f45903c79..614a138f9 100644 --- a/backend/src/app/rpc/commands/binfile.clj +++ b/backend/src/app/rpc/commands/binfile.clj @@ -719,6 +719,7 @@ file-id' (lookup-index file-id) thumbnails (:thumbnails file) + file (update file :features cfeat/migrate-legacy-features) features (-> enabled-features (set/difference cfeat/frontend-only-features) diff --git a/common/src/app/common/features.cljc b/common/src/app/common/features.cljc index e0b19a156..fc4bcab22 100644 --- a/common/src/app/common/features.cljc +++ b/common/src/app/common/features.cljc @@ -97,6 +97,24 @@ :feature-fdata-pointer-map "fdata/pointer-map" nil)) +(defn migrate-legacy-features + "A helper that translates old feature names to new names" + [features] + (cond-> (or features #{}) + (contains? features "storage/pointer-map") + (-> (conj "fdata/pointer-map") + (disj "storage/pointer-map")) + + (contains? features "storage/objects-map") + (-> (conj "fdata/objects-map") + (disj "storage/objects-map")) + + (or (contains? features "internal/geom-record") + (contains? features "internal/shape-record")) + (-> (conj "fdata/shape-data-type") + (disj "internal/geom-record") + (disj "internal/shape-record")))) + (def xf-supported-features (filter (partial contains? supported-features)))