mirror of
https://github.com/penpot/penpot.git
synced 2025-08-01 16:38:35 +02:00
✨ Make the hash optional on binfile-v3
Backport the change from develop
This commit is contained in:
parent
27ab910a64
commit
3131eec271
2 changed files with 11 additions and 8 deletions
|
@ -6,6 +6,8 @@
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Update plugins runtime [Github #6604](https://github.com/penpot/penpot/pull/6604)
|
- Update plugins runtime [Github #6604](https://github.com/penpot/penpot/pull/6604)
|
||||||
|
- Backport from develop a minor fix that enables import of files
|
||||||
|
generated by penpot library [Github #6614](https://github.com/penpot/penpot/pull/6614)
|
||||||
|
|
||||||
|
|
||||||
## 2.7.1
|
## 2.7.1
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
[:size ::sm/int]
|
[:size ::sm/int]
|
||||||
[:content-type :string]
|
[:content-type :string]
|
||||||
[:bucket [::sm/one-of {:format :string} sto/valid-buckets]]
|
[:bucket [::sm/one-of {:format :string} sto/valid-buckets]]
|
||||||
[:hash :string]])
|
[:hash {:optional true} :string]])
|
||||||
|
|
||||||
(def ^:private schema:file-thumbnail
|
(def ^:private schema:file-thumbnail
|
||||||
[:map {:title "FileThumbnail"}
|
[:map {:title "FileThumbnail"}
|
||||||
|
@ -821,13 +821,14 @@
|
||||||
:expected-size (:size object)
|
:expected-size (:size object)
|
||||||
:found-size (sto/get-size content)))
|
:found-size (sto/get-size content)))
|
||||||
|
|
||||||
(when (not= (:hash object) (sto/get-hash content))
|
(when-let [hash (get object :hash)]
|
||||||
(ex/raise :type :validation
|
(when (not= hash (sto/get-hash content))
|
||||||
:code :inconsistent-penpot-file
|
(ex/raise :type :validation
|
||||||
:hint "found corrupted storage object: hash does not match"
|
:code :inconsistent-penpot-file
|
||||||
:path path
|
:hint "found corrupted storage object: hash does not match"
|
||||||
:expected-hash (:hash object)
|
:path path
|
||||||
:found-hash (sto/get-hash content)))
|
:expected-hash (:hash object)
|
||||||
|
:found-hash (sto/get-hash content))))
|
||||||
|
|
||||||
(let [params (-> object
|
(let [params (-> object
|
||||||
(dissoc :id :size)
|
(dissoc :id :size)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue