Fork me on GitHub
#fulcro
<
2020-10-16
>
JAtkins02:10:36

Can UISM instances be actors in other UISM instances? It seems that it's possible, but kinda weird since actors are idents and the only way to trigger UISM events is via the id (not ident). Maybe I'm just missing the helper fn?

tony.kay01:10:59

Technically yes. Anything with an ident can be an actor, but of course I/O integration is around UI components, so that is not really the intention.

tony.kay01:10:30

I’d typically say what you want to do is send other UISM IDs as event data, and store that in the local store of the UISM…really all you typically want to do is “signal” other state machines…so that is enough, and you know what “table” they live in, so having their ID means you know where to look in state if you wanted to gaze into them to look for things like “current state”

JAtkins01:10:46

Cool, that works.

zilti15:10:44

I have a problem with a component here. I load all data needed in :will-enter, and that component shows up with the correct data very quickly (as I expect it to). But... after it has shown up with all the data expected, for some reason there is a ton of work going on server-side still, for over 10 seconds even with a small dataset of less than 100 entries. Whatever action I try to trigger client-side gets queued and blocks until the server is done with that mysterious thing. Did anyone have that before, and can maybe give me some pointers how to figure out what's going on?

tony.kay17:10:20

nothing Fulcro is doing.

Jakub Holý (HolyJak)20:10:20

Take a stack trace(s) of the server to see what is it doing. Perhaps something somehow triggered by the resolver you invoked?

zilti12:10:57

Well, it is to my best guess either Fulcro or Pathom. Or a weird undocumented behaviour I have to "opt out" of. I extracted the relevant code involved: https://gitlab.com/-/snippets/2032194

zilti13:10:10

Fulcro RAD Datomic runs this one for every single account in the entire system after my actual query I posted above has been run and the results are already displayed:

_rad.database-adapters.datomic:-385 - Running [:account/first-name :account/last-name :account/roles :account/job-title :account/headline :account/photo :account/email :account/email-verified? {:account/approved [:tenant/id]} :password/hashed-value :password/iterations :password/salt :account/accepted-tos-version :account/bio {:account/languages [:language/id]} {:account/vendor-type [:vendor-type/id]} :account/vc-contact :account/location {:account/vendor-specialism [:vendor-specialism/id]} {:account/vendor-skills [:vendor-skill/id]} {:account/vendor-geo-expertises [:vendor-geo-expertise/id]} {:account/vendor-industry-experiences [:vendor-industry-experience/id]} {:account/worked-with [:external-company/id]} :account/password-reset-id {:account/links [:link/id]} :account/created :time/created] on entities with  :account/id : [[:account/id #uuid "95a2dbec-ba46-4463-8e5d-5a6eddba95b2"]]

zilti13:10:38

And this query doesn't exist anywhere in my code base. This is every existing attribute where ao/identities is set to :account/id. I have no idea why it gets triggered, and why only in this one case

cjmurphy15:10:38

I wouldn't be loading in :will-enter . I would load in one of three places - start up, user event or timer event. And none of these require :will-enter .

cjmurphy15:10:52

If you call the df/load just from a button do you get the same problem?

zilti15:10:58

I will try that tomorrow morning, but a button is not really an option. Might help for debugging the problem though, thanks!

cjmurphy15:10:56

Also you don't show the resolver or the call site. I'm happy to try to replicate. Button just for debugging the problem, to see if it still happens when simple invocation.

cjmurphy16:10:19

I realise :will-enter just means 'been routed to' and that examples in the book and RAD use it for doing serious work, including loading. So I should have been a bit more nuanced in what I said before. But nothing wrong with taking routing out of the picture. How did it go?

Adam Helins16:10:50

When a mutation throws, the stacktrace being logged does not contain any information about what's happening in the mutation. It stops right before, more or less at com.fulcrologic.fulcro.algorithms.tx-processing/run-actions!. This is of course very hard to work with. Is this behavior normal or is something wrong on my side of things?

tony.kay17:10:48

Use exception breakpoints in js console

👍 3
tony.kay17:10:55

more informative anyway

ianjones20:10:34

has anyone in here written a guide on how to add an http-remote to fulcro? looks like the book is out of date

xceno21:10:40

When you look here: https://github.com/fulcrologic/fulcro-rad-demo/blob/master/src/shared/com/example/client.cljs#L33 You can override the remote config by doing:

(defonce app (rad-app/fulcro-rad-app
               {:remotes {:some-remote (net/fulcro-http-remote {:url "/other-api"})}
                :client-will-mount (...etc)}))

ianjones21:10:03

oh awesome, thanks!