This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-31
Channels
- # aatree (1)
- # admin-announcements (3)
- # aws (3)
- # beginners (36)
- # boot (227)
- # cljsrn (27)
- # clojure (57)
- # clojure-czech (6)
- # clojure-miami (8)
- # clojure-poland (17)
- # clojure-russia (113)
- # clojurescript (9)
- # community-development (1)
- # core-async (11)
- # core-matrix (2)
- # core-typed (3)
- # cursive (3)
- # datomic (5)
- # editors (40)
- # emacs (6)
- # heroku (1)
- # hoplon (50)
- # incanter (1)
- # ldnclj (4)
- # luminus (3)
- # mount (1)
- # om (132)
- # onyx (5)
- # proton (3)
- # re-frame (5)
- # spacemacs (1)
- # testing (12)
- # yada (6)
@laforge49, @flyboarder, I figured out what the problem was. It wasn’t with my code! (refresher: My problem is the thing with *session*
not working as expected) Turns out the problematic bit was the handler, as generated by lein new hoplon-castra
.
(def app
(-> app-routes
(d/wrap-defaults d/api-defaults)
(castra/wrap-castra-session "a 16-byte secret")
(castra/wrap-castra ’thingy.api)))
If I rearrange it by moving the form up to the top like so:
(def app
(-> app-routes
(castra/wrap-castra ’thingy.api)
(d/wrap-defaults d/api-defaults)
(castra/wrap-castra-session "a 16-byte secret")))
*session*
suddenly works. Which is great, except I don’t exactly know why this is causing the screwup. Do you guys have any idea?Could be something else interacting with session, in the stack
I have all my Castra forms up top and wrap defaults last
thing is, when i apply that to the demos
sessions stop working
i mean, when i use the arrangement as in the hoplon castra template, the demo breaks
specifically, castra-chat
That may be something we need to fix in the template, I'm not sure who usually works on that but I'm sure they are open to a PR
@flyboarder: Do you think I should file an issue somewhere, like the hoplon castra repo? After all, you seem to think the order shouldn’t matter much. Or perhaps I should tag micha or alan?
@levitanong: the order in which middleware are applied definitely matters
On advice from micha,, I have this which works: (-> app-routes (castra/wrap-castra 'castra-notify-chat.chat-api 'castra-notify-chat.user-api 'notify.notification-api) (castra/wrap-castra-session "a 16-byte secret") (d/wrap-defaults d/api-defaults))) So like @flyboarder I have defaults on the bottom. And like @levitanong 's arrangement that works, I have wrap castra thingie on top. The actual problem is that the template is backwards because -> reverses the order.
because it's a pipeline, each layer adding information for the subsequent layers to use
yay I’m not crazy!
thanks, @micha, @laforge49 and @flyboarder
It's like your alpha11. Lots of folk are just going to do a boot show -u and upgrade to alpha11. It is a trap for the greater community.
@levitanong: excellent issue (#78), thanks for the clear repro case
Hurrah! Just doing my part, @micha
this fix also keeps the behavior of https://github.com/hoplon/hoplon/pull/72, so the memory leak is still avoided in those situations
Hurrah! You the man, @micha
@micha, this line looks wrong: https://github.com/hoplon/hoplon/commit/cb32745f8c768ad6899abc7ce032b11d61dd9c20#diff-7baf7c718bc1c3e523a985c0dc23ad5cR96
^ was about to ask if you were going to bump the version to 13 😛