Fork me on GitHub
Mark Wardle10:09:19

A note for my future self: If data are not showing up in the UI, or in the client database, and yet the query generated over the network is fine, as is the response - check and double check resolvers are returning VECTORS and not lists. Turn map into mapv, or enclose with 'vec'. Otherwise, the results are dropped and one ends up with empty results. I see from the archive this has cropped up before. I wonder if the default in either pathom or fulcro is to turn any lazy sequence into a vector? I'm not sure whether this is a pathom or fulcro thing.

gratitude 2
Jakub Holý (HolyJak)16:09:03

The default in EDN is to turn lazy seq into a list. I need to update my troubleshooting guide for this case, as Gene has already suggested 😅

👍 1
Mark Wardle06:09:34

This has only caught me as I have a server that was used by a re-frame front-end, which I am rewriting using Fulcro. I expect I would have been tripped up on fewer occasions were it not for that.

Jakub Holý (HolyJak)11:09:52

I tried to replicate the problem but it seems that at least on latest Fulcro and when Pathom runs in the browser it is not a problem - if you run and press the Load things button it just works. If it is broken when using a real clj backend then that would locate the cause somewhere into transit processing...

Mark Wardle16:09:57

Thanks @U0522TWDA. Yes, perhaps it is an issue with transit then. The data comes across - I can see it in the network transaction, but lists are not processed in the same way as vectors and so one just ends up with missing data, but no error message - ie the client db is missing the data and therefore the props sent down to the component are also missing. Returning all collections as vectors server-side fixes the issue, but given we in Clojure-land think in terms of abstractions like sequences rather than concrete implementations, it's unclear to me what's happening.

Jakub Holý (HolyJak)16:09:38

Interesting. I tried this now in rad-demo and there the lazy list is sent over as a vector.

Mark Wardle17:09:39

The lazy list is sent - I can see the data correctly in the Fulcro network tab, the EQL query panel and in a connected pathom viz. Perhaps I'm doing something funny in my client. I will double check! Thank you!

Jakub Holý (HolyJak)17:09:32

I know it is sent. I am now working on replicating it in a base set up to see what happens there.

Jakub Holý (HolyJak)17:09:47

I know the problem is real, multiple ppl have been hit by it incl. me.

❤️ 1
Jakub Holý (HolyJak)08:09:40

FYI I managed to replicate the problem here and will look more into understanding what is causing it