diff --git a/backend/src/app/srepl/helpers.clj b/backend/src/app/srepl/helpers.clj index c3f97898ff..0e0ae6f20d 100644 --- a/backend/src/app/srepl/helpers.clj +++ b/backend/src/app/srepl/helpers.clj @@ -123,10 +123,6 @@ (defn process-file! [system file-id update-fn & {:keys [label validate? with-libraries?] :or {validate? true} :as opts}] - - (when (string? label) - (fsnap/create-file-snapshot! system nil file-id label)) - (let [conn (db/get-connection system) file (get-file system file-id) libs (when with-libraries? @@ -144,6 +140,9 @@ (when validate? (cfv/validate-file-schema! file')) + (when (string? label) + (fsnap/create-file-snapshot! system nil file-id label)) + (let [file' (update file' :revn inc)] (update-file! system file') true))))