diff --git a/backend/src/app/rpc/commands/management.clj b/backend/src/app/rpc/commands/management.clj index b0ac390b57..a71e81100c 100644 --- a/backend/src/app/rpc/commands/management.clj +++ b/backend/src/app/rpc/commands/management.clj @@ -106,10 +106,12 @@ (db/exec-one! conn ["SET CONSTRAINTS ALL DEFERRED"]) (binding [bfc/*state* (volatile! {:index {file-id (uuid/next)}})] - (duplicate-file (assoc cfg ::bfc/timestamp (ct/now)) - (-> params - (assoc :profile-id profile-id) - (assoc :reset-shared-flag true))))))) + (-> (duplicate-file (assoc cfg ::bfc/timestamp (ct/now)) + (-> params + (assoc :profile-id profile-id) + (assoc :reset-shared-flag true))) + ;; Clients only need the metadata, don't send the full file contents. + (dissoc :data)))))) ;; --- COMMAND: Duplicate Project diff --git a/backend/test/backend_tests/rpc_management_test.clj b/backend/test/backend_tests/rpc_management_test.clj index eec3aaabb9..ef353511c9 100644 --- a/backend/test/backend_tests/rpc_management_test.clj +++ b/backend/test/backend_tests/rpc_management_test.clj @@ -167,11 +167,8 @@ (t/is (= (:media-id item) (:media-id mobj))) (t/is (= (:media-id item) (:id sobject))) - ;; Check if media correctly contains the new file-media-object id - (t/is (contains? (get-in result [:data :media]) (:id item))) - - ;; And does not contains the old one - (t/is (not (contains? (get-in result [:data :media]) (:id mobj))))) + ;; The response carries the file metadata only + (t/is (not (contains? result :data)))) ;; Check the total number of files (let [rows (th/db-query :file {:project-id (:id project)})]