@huahaiy as a follow up to my issue a few days ago - It seems that storing an error as a value in datalevin is what causes corrupting the entity:
(let [conn (d/create-conn "db.dl")]
(d/transact!
conn
[{:entity-with-error (ex-info "Boom" {})}])
(d/entity (d/db conn) 1) ;; Looks good
(d/transact!
conn
[[:db/retractEntity 1]])
(d/entity (d/db conn) 1) ;; Still exists
(d/touch (d/entity (d/db conn) 1)) ;; Can still return data
)
Any ideas on how I can work around this beyond migrating the data (minus the entity). Want me to open an issue on GitHub?
On further investigation, I found the following:
1. You can still add attributes to the affected entity via :db/add
2. You cannot retract the error attribute via :db/retract
3. You cannot retract the entity via :db/retractEntity (probably because of 2)
4. You can retract other attributes on the entity via :db/retractSure, open an issue and I will investigate