diff --git a/.gitignore b/.gitignore index d11830e816..f34bc1676f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ figwheel_server.log -*jar +*.penpot +*.jar *-init.clj .lein-deps-sum .lein-failures @@ -9,9 +10,10 @@ figwheel_server.log .nrepl-port .cpcache .rebel_readline_history +node_modules +/clj-profiler/ /vendor/**/target /cd.md -node_modules /backend/target/ /backend/resources/public/media /backend/resources/public/assets diff --git a/backend/src/app/srepl/main.clj b/backend/src/app/srepl/main.clj index 6e9fc80d61..19274cfb22 100644 --- a/backend/src/app/srepl/main.clj +++ b/backend/src/app/srepl/main.clj @@ -2,9 +2,10 @@ "A main namespace for server repl." #_:clj-kondo/ignore (:require + [app.common.data :as d] [app.common.pages :as cp] - [app.common.uuid :as uuid] [app.common.pages.migrations :as pmg] + [app.common.uuid :as uuid] [app.config :as cfg] [app.db :as db] [app.db.sql :as sql] @@ -12,12 +13,12 @@ [app.rpc.queries.profile :as prof] [app.srepl.dev :as dev] [app.util.blob :as blob] - [cuerdas.core :as str] - [clojure.pprint :refer [pprint]])) + [clojure.pprint :refer [pprint]] + [cuerdas.core :as str])) (defn update-file - ([id f] (update-file id f false)) - ([id f save?] + ([system id f] (update-file system id f false)) + ([system id f save?] (db/with-atomic [conn (:app.db/pool system)] (let [file (db/get-by-id conn :file id {:for-update true}) file (-> file diff --git a/frontend/src/app/main/ui/shapes/path.cljs b/frontend/src/app/main/ui/shapes/path.cljs index 8c2decdc6f..e62fb46e86 100644 --- a/frontend/src/app/main/ui/shapes/path.cljs +++ b/frontend/src/app/main/ui/shapes/path.cljs @@ -6,6 +6,7 @@ (ns app.main.ui.shapes.path (:require + [app.common.logging :as log] [app.main.ui.shapes.attrs :as attrs] [app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]] [app.util.object :as obj] @@ -19,10 +20,21 @@ [props] (let [shape (unchecked-get props "shape") content (:content shape) - pdata (mf/use-memo (mf/deps content) #(upf/format-path content)) + pdata (mf/use-memo + (mf/deps content) + (fn [] + (try + (upf/format-path content) + (catch :default e + (log/error :hint "unexpected error on formating path" + :shape-name (:name shape) + :shape-id (:id shape) + :cause e) + "")))) + props (-> (attrs/extract-style-attrs shape) (obj/merge! #js {:d pdata}))] + [:& shape-custom-stroke {:shape shape} [:> :path props]])) - diff --git a/frontend/src/app/main/ui/workspace/viewport/outline.cljs b/frontend/src/app/main/ui/workspace/viewport/outline.cljs index 44d644f6b0..d4c41ad5d4 100644 --- a/frontend/src/app/main/ui/workspace/viewport/outline.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/outline.cljs @@ -6,6 +6,7 @@ (ns app.main.ui.workspace.viewport.outline (:require + [app.common.exceptions :as ex] [app.common.geom.shapes :as gsh] [app.common.pages :as cp] [app.main.refs :as refs] @@ -27,7 +28,9 @@ path-data (mf/use-memo (mf/deps shape) - #(when path? (upf/format-path (:content shape)))) + #(when path? + (or (ex/ignoring (upf/format-path (:content shape))) + ""))) {:keys [x y width height selrect]} shape