False negative on :db.entity/attrs

Schema

[{:db/ident        :foo/bar
  :db/valueType    :db.type/boolean
  :db/cardinality  :db.cardinality/one}
 {:db/ident        :foo/guard
  :db.entity/attrs [:foo/bar]}]

We can validate the required attribute by requesting the entity spec

{:foo/bar   true
 :db/ensure :foo/guard}

However the boolean value false is interpreted as missing schema

{:foo/bar   false
 :db/ensure :foo/guard}

Error:

Execution error (ExceptionInfo) at datomic.core.error/raise (error.clj:55).
:db.error/entity-attr Entity -9223301668109579638 missing attributes (:foo/bar) of spec :foo/guard

Environment:

  • dev-local 0.9.232

Hi @hden

We have reproduced this behavior and will release a fix in an upcoming release. I’ll circle back when it’s available. Thank you for the report!

1 Like

I realized today when auditing older stories that I never circled back to update that we released a fix for this issue on 7/13/2021 with Local Dev and CI with Datomic Local | Datomic.

Updated here in case someone is searching this issue out.

1 Like