Closed austinhaas closed 5 years ago
We should preserve false
for sure. But Datomic prohibits nil values in a transaction.
I think it'd be better to let Datomic complain about the nil (assuming it throws an exception), rather than silently dropping a user-supplied value.
I think false
should be preserved as well. Perhaps we log that nil
values are not allowed but maintain their removal before passing to Datomic.
False values are removed from the payload before transacting. False values should be allowed and transacted into the database.
I believe the problem is here: https://github.com/cognitect-labs/vase/blob/bf96190bba7a7cc5efd92ea6f60503f0dc7800db/src/com/cognitect/vase/actions.clj#L399
This line should be changed from
#(into {} (filter second (select-keys % ~(vec properties))))
to#(into {} (remove (comp nil? second) (select-keys % ~(vec properties))))
Or, just
#(select-keys % ~(vec properties))
The result of
select-keys
doesn't include keys not found in the map, and ifnil
is actually a value that the user supplied, then this function shouldn't silently remove it.