This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-20
Channels
- # aleph (12)
- # announcements (7)
- # aws (6)
- # babashka (36)
- # beginners (161)
- # boot (1)
- # calva (6)
- # cider (21)
- # clj-kondo (13)
- # cljs-dev (28)
- # cljsrn (1)
- # clojars (3)
- # clojure (13)
- # clojure-colombia (1)
- # clojure-europe (10)
- # clojure-spec (12)
- # clojure-uk (47)
- # clojuredesign-podcast (2)
- # clojurescript (67)
- # datascript (8)
- # datomic (21)
- # duct (3)
- # emacs (6)
- # events (1)
- # fulcro (6)
- # graalvm (98)
- # jobs (1)
- # kaocha (18)
- # luminus (1)
- # malli (7)
- # off-topic (56)
- # pathom (5)
- # re-frame (18)
- # reagent (3)
- # reitit (9)
- # remote-jobs (3)
- # rewrite-clj (10)
- # ring (1)
- # shadow-cljs (155)
- # spacemacs (2)
- # sql (5)
- # tools-deps (27)
- # vim (86)
- # xtdb (2)
As far as I can tell that should work. I would be interested in seeing whether breaking that into two transactions works. But this should work in Datomic and I would expect it to in DataScript. I'd GH issue.
Yeah, I'm thinking it's some new VM optimisation breaking protocols. Behold the insanity...
datascript.db/maybe-wrap-multival.b not a collection at all, so definitely a single value {vs [{:sighting/id 123}], (type vs) #object[_i], (arrays/array? vs) false, (coll? vs) false, (map? vs) false}
That debugging statement confirms that vs
which is a vector is not a coll?
!
I'd had fleeting glimpses of some odd behaviour with clj->js recently which I'm starting to suspect is related to the same issue.
Here's some sample code and logged output. Note that vs
is a vector, (coll? vs)
is false but (satisfies? ICollection vs)
is true!
https://gist.github.com/olivergeorge/f4251884d74f32bba2025ebc48b626ef
Only observed using the release config on iOS simulator so I guess some VM optimisation is causing an issue.
Late follow up on this. Problem was not with datascript.
[{:sighting/id 123}] isnt a collection of lookup It should be [[:sighting/id 123]] @olivergeorge