This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-21
Channels
- # adventofcode (27)
- # announcements (2)
- # babashka (1)
- # beginners (111)
- # calva (11)
- # cider (82)
- # clara (6)
- # clojure (44)
- # clojure-dev (5)
- # clojure-europe (27)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (29)
- # core-async (5)
- # cursive (4)
- # datalevin (1)
- # datomic (39)
- # exercism (4)
- # figwheel-main (1)
- # fulcro (32)
- # graalvm (7)
- # gratitude (1)
- # integrant (4)
- # jobs (1)
- # lein-figwheel (3)
- # leiningen (4)
- # lsp (3)
- # luminus (3)
- # meander (2)
- # nextjournal (1)
- # off-topic (10)
- # other-languages (26)
- # pathom (14)
- # polylith (9)
- # re-frame (16)
- # remote-jobs (1)
- # shadow-cljs (4)
- # specter (2)
- # sql (6)
- # timbre (2)
- # tools-build (12)
- # xtdb (9)
lost a bit of time on this "trap for young players" today :rolling_on_the_floor_laughing:
(let [d 1
node (xt/start-node {})]
(xt/await-tx
node
(xt/submit-tx
node
[
[::xt/put {:xt/id {:n (int d)}}]
[::xt/put {:xt/id (int d)}]]))
(let [db (xt/db node)]
[
(xt/entity db d)
(xt/entity db {:n d})]))
result:
[{:xt/id 1} nil]
it's not a bug, but an artifact of
[
(=
(c/new-id {:x (int 1)})
(c/new-id {:x (long 1)}))
(=
(c/new-id (int 1))
(c/new-id (long 1)))])
result
[false true]
oh dear, interesting though! This is a side-effect of how we use Nippy. The equality semantics of maps is already complicated enough 🙈
@U01ENMKTW0J If you're keen to install signposts which warn future youthful travellers, this is definitely the sort of thing that could go on http://discuss.xtdb.com where the googles and ducks can find them. 🙂 (As always, no obligation.)
Done! https://discuss.xtdb.com/t/entity-document-ids-with-nested-maps-and-equality-semantics/42
Cross posting but i am not even sorry https://clojurians.slack.com/archives/C02BJCKN0R4/p1640120358230800 Thank youuuuu ❤️