From 5359ff04cf568eb6a7de2535e66372c3a7109729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero=20Cantero?= Date: Fri, 7 Aug 2026 08:02:58 +0200 Subject: [PATCH 1/2] :paperclip: Drop an unused binding in create-font-variant `create-font-variant` destructures `uploads` and never reads it: the handler passes the whole `params` map to `prepare-font-data-from-uploads`. `clj-kondo` reports it as an unused binding and exits 2, which fails the Lint step of the Backend workflow, and the Lint step runs before the tests, so no branch based on `develop` can run the backend suite at all. AI-assisted-by: mixed models --- backend/src/app/rpc/commands/fonts.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/app/rpc/commands/fonts.clj b/backend/src/app/rpc/commands/fonts.clj index 6f9f9bb109..c0ca2d8da7 100644 --- a/backend/src/app/rpc/commands/fonts.clj +++ b/backend/src/app/rpc/commands/fonts.clj @@ -144,7 +144,7 @@ [:process-font/global]] ::webhooks/event? true ::sm/params schema:create-font-variant} - [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id team-id font-id uploads] :as params}] + [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id team-id font-id] :as params}] (teams/check-edition-permissions! pool profile-id team-id) (check-font-team-ownership! pool team-id font-id) (quotes/check! cfg {::quotes/id ::quotes/font-variants-per-team From bc9319eac59e8b7bd3d38e000b1bc29fef52c629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero=20Cantero?= Date: Fri, 7 Aug 2026 08:02:58 +0200 Subject: [PATCH 2/2] :bug: Port the foreign-font-id test to the uploads API `create-font-variant-rejects-foreign-font-id` sends `:data`, which `schema:create-font-variant` no longer accepts: the same commit that added the test documents that param as removed in 2.18 in favour of `:uploads`. Both of the test's requests are therefore rejected by params validation before they reach `check-font-team-ownership!`, which is the thing the test exists to check. It asserted nothing about ownership and failed three assertions. Upload the font through `upload-font-chunked!`, the helper the other tests in this namespace already use, and pass the session id in `:uploads`. `backend-tests.rpc-font-test` is 16 tests, 172 assertions, 0 failures with this applied. AI-assisted-by: mixed models --- backend/test/backend_tests/rpc_font_test.clj | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/test/backend_tests/rpc_font_test.clj b/backend/test/backend_tests/rpc_font_test.clj index fc771ebbf1..d7b326e5ed 100644 --- a/backend/test/backend_tests/rpc_font_test.clj +++ b/backend/test/backend_tests/rpc_font_test.clj @@ -623,27 +623,29 @@ (io/read*))] ;; prof1 creates a font variant in team1 with font-id - (let [params {::th/type :create-font-variant + (let [session-id (upload-font-chunked! prof1 data "font/ttf" (* 4 1024 1024)) + params {::th/type :create-font-variant ::rpc/profile-id (:id prof1) :team-id team1 :font-id font-id :font-family "SharedFont" :font-weight 400 :font-style "normal" - :data {"font/ttf" data}} + :uploads {"font/ttf" session-id}} out (th/command! params)] (t/is (nil? (:error out)))) ;; prof2 tries to create a variant using the same font-id but - ;; in team2 — must be rejected because font-id belongs to team1 - (let [params {::th/type :create-font-variant + ;; in team2, which must be rejected because font-id belongs to team1 + (let [session-id (upload-font-chunked! prof2 data "font/ttf" (* 4 1024 1024)) + params {::th/type :create-font-variant ::rpc/profile-id (:id prof2) :team-id team2 :font-id font-id :font-family "SharedFont" :font-weight 700 :font-style "normal" - :data {"font/ttf" data}} + :uploads {"font/ttf" session-id}} out (th/command! params)] (t/is (some? (:error out))) (t/is (= :not-found (-> out :error ex-data :type)))