Fork me on GitHub
#hoplon
<
2015-10-07
>
flyboarder03:10:56

@mynomoto: in the castra chat demo (get-state) rpc call, is this line for (nil? user) needed?

mynomoto03:10:17

@flyboarder: I'm not sure, I remember finding that odd too but I think removing it caused some kind of trouble.

flyboarder03:10:59

doesnt the rpc call fail if any of the :rpc/pre return a false value?

flyboarder03:10:14

strange, then the initial call to (get-state) on the client would fail? 😕

mynomoto03:10:50

It only is used when called directly. So if another rpc calls it, it's ignored.

mynomoto03:10:35

Yes, that will get the message for the user to login on the screen I think.

flyboarder03:10:12

ok i see i think

mynomoto03:10:58

But will fail because there is no user on session.

flyboarder03:10:03

so in the initial call user is nil and it fails on the login check

mynomoto03:10:14

gtg now, but you can just ask questions here, someone will get to it, maybe myself tomorrow.

flyboarder03:10:22

and the other rpc calls which use it ignore the :rpc/pre , i think i get it

flyboarder03:10:50

so the only :rpc/pre which is used is the originating one

mynomoto11:10:33

@flyboarder: yeah, this is how it works.

flyboarder18:10:44

@onetom: you mentioned you were using castra with a db backend previously, im wondering how you are handling the db connection?

onetom18:10:04

Handling in what sense?

flyboarder18:10:23

how are you storing the db connection? in a local scope on the castra call or should i be persisting the db connection to a state cell?

flyboarder18:10:39

my thought was to keep all db stuff on the server

onetom18:10:35

Im not sure I understand your question. What kind of db do u use?

onetom18:10:18

We use datomic and we just get a db connection at startup

onetom18:10:52

Ah so ur problem is the authentication, right?

flyboarder18:10:41

sorry still trying to sort out how this all falls into place with the technologies we wanted to use

flyboarder18:10:08

i haven't heard of datomic before, looking into it

onetom18:10:30

let me have a quick look at some example

onetom18:10:45

in the meantime let me show u the meat of our solution

onetom18:10:07

and im serving it with boot-http like this:

(serve :port 3001
               :reload true
               :handler 'appboard.api/ring-handler)

onetom19:10:44

i checked if i have any example source to open up, but i only have a boot1/hoplon5 solution

onetom19:10:45

flyboarder: im about to sleep coz it's 3am here. if u have any questions, shoot them quick 😉 i will be up in 5 hours though so i can answer then too

flyboarder19:10:17

have a good night, im just reading the castra source for now, thanks for the help i need to dive into the ring sessions more

onetom19:10:46

as u can see i had a comment in my source about an article which helped me to understand things a bit better; it might help u too

flyboarder21:10:47

@micha: is the wrap-castra-session required if I wanted to use another session store?

micha22:10:28

@flyboarder: no, it's just to simplify sessions when using CORS