mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 08:38:15 -05:00
Merge pull request #3497 from penpot/niwinz-staging-bugfixes-6
🐛 Fix incorrect implementation on error reporting context collection
This commit is contained in:
commit
a494b89bba
2 changed files with 28 additions and 13 deletions
|
@ -40,16 +40,16 @@
|
||||||
[{:keys [::l/context ::l/message ::l/props ::l/logger ::l/level ::l/cause] :as record}]
|
[{:keys [::l/context ::l/message ::l/props ::l/logger ::l/level ::l/cause] :as record}]
|
||||||
(us/assert! ::l/record record)
|
(us/assert! ::l/record record)
|
||||||
|
|
||||||
(let [data (ex-data cause)
|
(let [data (ex-data cause)
|
||||||
context (-> context
|
ctx (-> context
|
||||||
(assoc :tenant (cf/get :tenant))
|
(assoc :tenant (cf/get :tenant))
|
||||||
(assoc :host (cf/get :host))
|
(assoc :host (cf/get :host))
|
||||||
(assoc :public-uri (cf/get :public-uri))
|
(assoc :public-uri (cf/get :public-uri))
|
||||||
(assoc :logger/name logger)
|
(assoc :logger/name logger)
|
||||||
(assoc :logger/level level)
|
(assoc :logger/level level)
|
||||||
(dissoc :request/params :value :params :data))]
|
(dissoc :request/params :value :params :data))]
|
||||||
(merge
|
(merge
|
||||||
{:context (-> (into (sorted-map) context)
|
{:context (-> (into (sorted-map) ctx)
|
||||||
(pp/pprint-str :width 200 :length 50 :level 10))
|
(pp/pprint-str :width 200 :length 50 :level 10))
|
||||||
:props (pp/pprint-str props :width 200 :length 50)
|
:props (pp/pprint-str props :width 200 :length 50)
|
||||||
:hint (or (ex-message cause) @message)
|
:hint (or (ex-message cause) @message)
|
||||||
|
|
|
@ -11,13 +11,28 @@
|
||||||
[potok.core :as ptk]))
|
[potok.core :as ptk]))
|
||||||
|
|
||||||
(defn- generate-changes
|
(defn- generate-changes
|
||||||
[attr {:keys [objects id]}]
|
[attr {:keys [objects id] :as container}]
|
||||||
(let [base {:type :fix-obj attr id}
|
(let [base {:type :fix-obj attr id}
|
||||||
contains? (partial contains? objects)
|
contains? (partial contains? objects)
|
||||||
xform (comp
|
xform (comp
|
||||||
(remove #(every? contains? (:shapes %)))
|
;; FIXME: Ensure all obj have id field (this is needed
|
||||||
(map #(assoc base :id (:id %))))]
|
;; because some bug adds an ephimeral shape with id ZERO,
|
||||||
(sequence xform (vals objects))))
|
;; with a single attr `:shapes` having a vector of ids
|
||||||
|
;; pointing to not existing shapes). That happens on
|
||||||
|
;; components. THIS IS A WORKAOURD
|
||||||
|
(map (fn [[id obj]]
|
||||||
|
(if (some? (:id obj))
|
||||||
|
obj
|
||||||
|
(assoc obj :id id))))
|
||||||
|
|
||||||
|
;; Remove all valid shapes
|
||||||
|
(remove (fn [obj]
|
||||||
|
(every? contains? (:shapes obj))))
|
||||||
|
|
||||||
|
(map (fn [obj]
|
||||||
|
(assoc base :id (:id obj)))))]
|
||||||
|
|
||||||
|
(sequence xform objects)))
|
||||||
|
|
||||||
(defn fix-broken-shapes
|
(defn fix-broken-shapes
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Add table
Reference in a new issue