From e4d86cbb3903599c80b3c828a0d6f80ce9e0f8f1 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 14 Dec 2023 12:07:27 +0100 Subject: [PATCH] :bug: Fix incorrect feature handling on checking file features --- common/src/app/common/features.cljc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/src/app/common/features.cljc b/common/src/app/common/features.cljc index d627d1255..20c0ab601 100644 --- a/common/src/app/common/features.cljc +++ b/common/src/app/common/features.cljc @@ -193,7 +193,11 @@ ([enabled-features file-features] (check-file-features! enabled-features file-features #{})) ([enabled-features file-features client-features] - (let [file-features (into #{} xf-remove-ephimeral file-features)] + (let [file-features (into #{} xf-remove-ephimeral file-features) + ;; We should ignore all features that does not match with the + ;; `no-migration-features` set because we can't enable them + ;; as-is, because they probably need migrations + client-features (set/intersection client-features no-migration-features)] (let [not-supported (-> enabled-features (set/union client-features) (set/difference file-features) @@ -211,15 +215,11 @@ (check-supported-features! file-features) - (let [;; We should ignore all features that does not match with - ;; the `no-migration-features` set because we can't enable - ;; them as-is, because they probably need migrations - client-features (set/intersection client-features no-migration-features) - not-supported (-> file-features - (set/difference enabled-features) - (set/difference client-features) - (set/difference backend-only-features) - (set/difference frontend-only-features))] + (let [not-supported (-> file-features + (set/difference enabled-features) + (set/difference client-features) + (set/difference backend-only-features) + (set/difference frontend-only-features))] (when (seq not-supported) (ex/raise :type :restriction