Fork me on GitHub
Thomas Moerman15:08:25

@pt.roterski haven't tested it yet to confirm, but i think there's a small bug in the [adapter]( -> the and expression tests v but an attr with v being false should be kept as well. Testing with (some? v) is probably what is needed here. What do you think? I can log an issue later if you like.

Piotr Roterski20:08:52

Nice find @U052A8RUT ! Thank you for reading through this code. Let's think. This is the context:

(reduce (fn [e [k v]]
                                              (cond-> e
                                                (and v (get e k)) (assoc k v)))
We go over a seq of maps before, and if condition (and v (get e k)) is truthy a value v will be associated assoc under key k in entity e. If v is false :
(and false 5)
  ;; => false

  (and (some? false) 5)
  ;; => 5
without (some? v) falsevalues get silently ignored. That's not an expected behaviour. You are right, this is a bug and I'll fix this.

Piotr Roterski20:08:43

Thanks again for finding it, I appreciate it. 🙏 Feel free to use for more persistent issue tracker.

metal 2
Thomas Moerman21:08:43

You're welcome! Thank you for sharing this code 🙏

😊 2
Piotr Roterski11:08:48

@U052A8RUT just an update, I've pushed a fix together with a test case catching the bug and then released it as 0.0.1-alpha-4