This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-10
Channels
- # announcements (9)
- # babashka (19)
- # beginners (39)
- # calva (7)
- # cherry (1)
- # cider (2)
- # clojure (31)
- # clojure-europe (8)
- # clojure-norway (9)
- # datalevin (10)
- # events (2)
- # fulcro (10)
- # hyperfiddle (9)
- # joker (1)
- # lsp (50)
- # membrane (34)
- # minecraft (2)
- # missionary (21)
- # off-topic (17)
- # pedestal (1)
- # polylith (8)
- # reitit (3)
- # sql (4)
- # squint (16)
- # xtdb (14)
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.

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 😅
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.
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 https://github.com/holyjak/minimalist-fulcro-template-backendless/tree/demo/lazy-list-resolver 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...
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.
Interesting. I tried this now in rad-demo and there the lazy list is sent over as a vector.
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!
I know it is sent. I am now working on replicating it in a base set up to see what happens there.
I know the problem is real, multiple ppl have been hit by it incl. me.
FYI I managed to replicate the problem here https://github.com/holyjak/minimalist-fulcro-template/tree/tmp/lazy-list-resolver and will look more into understanding what is causing it