om

Please ask the channel first, not @dnolen directly!
peeja 2017-04-14T17:35:26.414352Z

@anmonteiro It appears to me that the compassus parser, for remote reads (that is, with a target), returns not a query but a single-element vector containing the query. Is that a known issue?

peeja 2017-04-14T17:36:46.436217Z

(It doesn't seem to break Om, though I'm not sure why.)

anmonteiro 2017-04-14T17:38:19.461489Z

@peeja doesn’t break Om because we wrap send https://github.com/compassus/compassus/blob/master/src/main/compassus/core.cljc#L289

anmonteiro 2017-04-14T17:38:38.466691Z

do you need a different behavior?

peeja 2017-04-14T17:38:44.468482Z

Oh. Huh.

peeja 2017-04-14T17:38:53.470885Z

Wouldn't it be better to make the parser do the right thing?

anmonteiro 2017-04-14T17:39:32.481252Z

@peeja so we previously had expr->ast in the parser

anmonteiro 2017-04-14T17:39:38.483136Z

but you noticed that wasn’t the right behavior 🙂

peeja 2017-04-14T17:39:52.486764Z

But we own the parser. We can make it return anything, right?

peeja 2017-04-14T17:39:57.488311Z

We can just unwrap it there

anmonteiro 2017-04-14T17:40:12.492305Z

I don’t recall what the problem was exactly

peeja 2017-04-14T17:40:30.497599Z

I think it was that it returned the query wrapped in a vector 🙂

anmonteiro 2017-04-14T17:40:40.500475Z

I know we fixed it here https://github.com/compassus/compassus/commit/8db377181842674334914ccf51fba0ab94e271c0

anmonteiro 2017-04-14T17:41:12.508817Z

oh right, we were doing (expr->ast (first ret))

peeja 2017-04-14T17:41:18.510847Z

Yeah, that was it

anmonteiro 2017-04-14T17:41:27.513415Z

thus ignoring (rest ret)

anmonteiro 2017-04-14T17:41:40.516779Z

I don’t see any easy fix

peeja 2017-04-14T17:41:46.518435Z

I do. I can PR it

peeja 2017-04-14T17:42:07.524233Z

We just need to make it the parser's job, not the read's job

anmonteiro 2017-04-14T17:42:41.533703Z

@peeja PR welcome if you know how it should be fixed

peeja 2017-04-14T17:57:54.793726Z

Hmm. Do we have some guarantee that :compassus.core/mixin-data and :compassus.core/route-data won't be read at the same time?

peeja 2017-04-14T17:58:08.797331Z

The current setup appears to assume they won't

anmonteiro 2017-04-14T17:59:05.813878Z

I think they could?

anmonteiro 2017-04-14T17:59:13.816011Z

when you’re re-rendering from root

peeja 2017-04-14T18:00:59.848567Z

Oh, no, you're right. There are test cases that cover it.

peeja 2017-04-14T19:42:03.457877Z

@anmonteiro So, if I'm reading this right, if :compassus.core/mixin-data and :compassus.core/route-data are read at the same time, the result of the parser will be a vector of two elements, one for each of those queries. Then wrap-send will concatenate those queries into a single query, and that's what'll go to the send.

peeja 2017-04-14T19:42:15.460664Z

But: if the two queries have any keys in common, that'll break

peeja 2017-04-14T19:43:07.473188Z

I'm not sure what the best way to deal with that is, but that's a potential issue that exists today.

anmonteiro 2017-04-14T20:01:44.746667Z

I think that’s fair

anmonteiro 2017-04-14T20:51:03.443959Z

@peeja thanks. I’ll review during the weekend

peeja 2017-04-14T21:04:15.629153Z

Cheers!