Fork me on GitHub
#datascript
<
2019-11-20
>
metasoarous03:11:21

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.

Oliver George08:11:11

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}

Oliver George08:11:39

That debugging statement confirms that vs which is a vector is not a coll?!

Oliver George08:11:56

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.

Oliver George08:11:08

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

Oliver George08:11:23

Only observed using the release config on iOS simulator so I guess some VM optimisation is causing an issue.

Oliver George12:12:00

Late follow up on this. Problem was not with datascript.

souenzzo11:11:37

[{:sighting/id 123}] isnt a collection of lookup It should be [[:sighting/id 123]] @olivergeorge