Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-22

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 jzawodn joined #mojo
00:12 Molaf_ joined #mojo
00:45 shmuel joined #mojo
00:45 chromatic Here's what worked in my code, by the way: http://pastebin.com/nHDm7NC0
00:51 sri $app should be $c, and i believe you might be killing uploads, which are Mojo::Upload objects
00:53 sri something like $c->req->params->params([map {NFC($_)} @{$c->req->params->params}]) should be quite a bit more efficient
00:54 chromatic the ref $value eq 'ARRAY' doesn't hurt Mojo::Upload objects. I hit that case in my tests.
00:54 sri the else block should kill it
00:54 sri odd
00:55 chromatic Yeah, I can't explain it either. Let me be more paranoid.
00:56 chromatic I suppose for whatever reason NFC doesn't stringify the reference.
00:56 sri interesting
00:57 chromatic No reason to rely on that.
00:58 * sri wonders if you've found a reason to add a before_routes hook
00:59 sri with a before routes hook you could normalize values captured from routes too
00:59 sri s/\ /_/
01:00 chromatic Not an issue for this client, but I see the value in that.
01:00 Molaf__ joined #mojo
01:05 egopro joined #mojo
01:07 mattastrophe joined #mojo
01:10 hlin joined #mojo
01:10 Mike-PerlRecruiter_ joined #mojo
01:17 ka2u joined #mojo
01:20 shmuel # Expiration date in seconds from now (persists between requests)
01:20 shmuel $c->session(expiration => 604800);
01:20 shmuel what does it means?
01:20 shmuel is the expiration being saved inside the session itself, and every request it will be automatically extend?
01:35 sri yes
01:50 shmuel sri: thanks.
01:54 d4rkie joined #mojo
01:54 d4rkie joined #mojo
02:19 shmuel is it possible to keep data from the 'under' hook so the routes below it will be able to use?
02:20 shmuel I'm authenticating a user, and want to keep the user object until the end of the request
02:21 shmuel I can stash it, I suppose.
02:22 shmuel is that the right way to do it?
02:33 buu Sure
02:33 buu I stash it!
02:33 bluescreen_ joined #mojo
02:40 shmuel thanks buu!
02:42 buu Hurray
02:42 xaka joined #mojo
02:55 jnbek joined #mojo
03:33 sivoais joined #mojo
03:33 TitanOfOld joined #mojo
03:39 mattastrophe joined #mojo
03:41 noganex joined #mojo
03:55 good_news_everyone joined #mojo
03:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/P1YyMw
03:55 good_news_everyone mojo/master 81ce848 Sebastian Riedel: small optimizations
03:55 good_news_everyone left #mojo
04:09 good_news_everyone joined #mojo
04:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Y_2TeA
04:09 good_news_everyone mojo/master 6458f12 Sebastian Riedel: documentation tweak
04:09 good_news_everyone left #mojo
04:12 marty_ joined #mojo
04:22 egopro joined #mojo
04:42 trmjoa joined #mojo
04:57 ka2u joined #mojo
05:16 xaka joined #mojo
05:18 ka2u joined #mojo
05:19 Miked joined #mojo
05:31 spleenjack joined #mojo
05:44 xaka joined #mojo
05:53 rem_lex|pivo joined #mojo
05:57 ver joined #mojo
06:15 sivoais joined #mojo
06:27 Vandal joined #mojo
06:27 spleenjack1 joined #mojo
06:39 dod joined #mojo
06:43 rem_lex joined #mojo
06:44 yakudza joined #mojo
06:56 dpetrov_ joined #mojo
06:58 spleenjack joined #mojo
07:09 Nom- left #mojo
07:13 sivoais joined #mojo
07:14 jnbek joined #mojo
07:25 lppoix joined #mojo
07:25 lppoix left #mojo
07:28 spleenjack joined #mojo
07:39 rem_lex|pivo joined #mojo
07:48 dod joined #mojo
07:52 egopro joined #mojo
07:58 egopro joined #mojo
08:01 spleenjack joined #mojo
08:05 amirite joined #mojo
08:11 suy joined #mojo
08:22 taryk joined #mojo
08:26 taryk left #mojo
08:38 Miked joined #mojo
08:49 ulric joined #mojo
08:58 wircus joined #mojo
09:01 judofyr joined #mojo
09:08 rhaen_fork joined #mojo
09:13 fhelmber_ joined #mojo
09:31 basic6 joined #mojo
09:44 janliesendahl_de joined #mojo
09:44 ObseLeTe joined #mojo
09:46 janliesendahl_de 00
09:58 egopro joined #mojo
10:01 jontaylor joined #mojo
10:11 rhaen_fork_ joined #mojo
10:14 rhaen_fork joined #mojo
10:14 basic6 should i use a POST route for creating something and a PUT route to update something, or the other way around?
10:15 suy joined #mojo
10:16 judofyr basic6: you can use POST for everything. POST basically means "this does something on the server"
10:17 judofyr basic6: you should use PUT if it's safe to execute the same request multiple times and it'll have same consequence.
10:18 judofyr basic6: e.g. it doesn't matter if you `PUT /profile_picture` just once or six times in a row; the result is the same.
10:18 judofyr basic6: but if you `POST /comments` (which creates a new comment) six times in a row, you get six duplicate comments. thus, you shouldn't use PUT for that.
10:19 judofyr basic6: PUT can both mean "create" (`PUT /image/foobar.jpg`) and "update"
10:20 basic6 this would be the case if I used POST for creating something (5x POST /item = 5 new items) and PUT for updating (5x PUT /item/id = this item is updated 5 times in the same way)
10:21 judofyr basic6: if you want to do a partial update, you're actually supposed to use PATCH: http://www.mnot.net/blog/2012/09/05/patch
10:21 judofyr basic6: yes. that would be a correct use case for PUT
10:24 migo joined #mojo
10:25 judofyr basic6: PUT was originally intended to fully replace the resource
10:25 basic6 ok thanks
11:07 jontaylor sri: I changed one of my servers to use prefork, and left the other one using hypnotoad, the prefork server worked fine, but the hypnotoad one has its workers fail to heartbeat still
11:08 jontaylor and this is after an extended period of inactvity
11:09 jontaylor So there may still be something in my app that blocks on taking a request if its been idle too long which gets triggered by hypnotoad
11:10 jontaylor but it just doesn't show when using morbo or prefork
11:10 jontaylor I can see from my front end webserver that last night nginx considered my hypnotoad upstream to have failed, and the prefork one then took 100% of requests
11:11 jontaylor for a minute until nginx tries hypnotoad again
11:11 jontaylor I have 16 worker processes so each one seemed to time out on being hit
11:12 jontaylor and after 16 minutes (1 request and then nginx ignores that server for a  minute)
11:12 jontaylor both then work fine
11:14 jontaylor I'm thinking as a work around I might set accepts => 1 and clients => 1
11:20 ryozi joined #mojo
11:38 Adurah joined #mojo
11:45 Miked joined #mojo
11:52 TitanOfOld joined #mojo
11:55 vervain joined #mojo
12:02 spleenjack joined #mojo
12:09 rhaen_fork joined #mojo
12:33 nic haha, just had to deploy onto perl v5.10.0
12:33 nic jamadam++
12:59 rhaen_fork joined #mojo
13:05 yakubori joined #mojo
13:05 yakubori o/
13:09 yakubori looking at the differences between sesssion 'expires' and 'expiration', where the latter is persitent and the former is not, what's the best way to clear out all session data? e.g. for a /logout handler?
13:10 ObseLeTe joined #mojo
13:11 Mike-PerlRecruiter_ joined #mojo
13:12 yakubori setting expires => 1 doesn't seem to clear out the session data.
13:19 TitanOfOld joined #mojo
13:20 yakubori is wrapping a block, which checks session data, inside of a helper going to cause something to persist in all cases?
13:28 yakubori at the moment, I can Dumper($self->session) inside of my /logout handler and see the 'expiration' value as well as a 'user_id'; which I set to undef during logout. Yet, a subsequnt call a helper (called authuser), with another Dumper($self->session), shows the 'expiration' value, and a 'user_id' value which is NOT undef.
13:29 yakubori assuming I haven't found yet another way to hose things… O-o
13:58 bluescreen joined #mojo
14:05 nic yakubori: As I understand it, the session id you're talking about is within the cookie
14:07 yakubori oh, so you can't simply "unset" the session data?
14:07 nic So if you're not persisting the info server-side then an old cookie can be used to resume being logged-in
14:07 nic depends what you mean by session data
14:08 nic for what's in the cookie, you can overwrite the cookie, but only if that new content makes its way to the client end
14:08 nic yakubori: Do you use a redirect within your /logout ?
14:09 yakubori no, no redirect. just return some json
14:09 nic In my case I was stung because a redirect didn't set new cookie content, so user remained logged-in post-redirect
14:09 yakubori either an error => $exception, or a message => 'logout'
14:10 nic Have you checked that the cookie is updated via your /logout process?
14:11 yakubori it looks like $self->session is an accessor for a simple hashref. so, after I saw the data persistence initially, i tried doing $self->session(user_id => undef), and it still persisted on a later 'authuser' call.
14:12 nic Have you checked that the cookie is updated via your /logout process?
14:13 rem_lex|pivo joined #mojo
14:15 yakubori hang on. looking at each of the request headers
14:16 Miked joined #mojo
14:16 ulric left #mojo
14:20 fhelmber_ joined #mojo
14:23 yakubori ok - it *looks* like my authuser requests are made with one cookie (from the previous response) and are returned another. that sounds a bit odd to me...
14:24 yakubori I must be screwing something up somewhere with regards to management.
14:24 yakubori i doubt this is something wrong with mojo
14:26 yakubori i'm wondering if I have a bunch of "authed" instances of this one user :P
14:28 yakubori BTTFM
14:35 bluescreen_ joined #mojo
14:44 gryphon joined #mojo
14:48 TitanOfOld joined #mojo
14:58 ka2u joined #mojo
15:08 yakubori what in Gumby's name did I do? :( Should there ever be a case where the session id should change while you're "authenticated"
15:11 mattastrophe joined #mojo
15:17 Britzel_ joined #mojo
15:17 lppoix joined #mojo
15:21 Kovensky http://www.youtube.com/watch?v=tJSQFzw1pEE <-- :D
15:23 yakubori Kovensky: HA!
15:38 TitanOfOld joined #mojo
15:39 inokenty joined #mojo
15:54 labrown joined #mojo
16:01 yakudza joined #mojo
16:10 vel joined #mojo
16:24 bluescreen_ joined #mojo
16:35 jnbek joined #mojo
16:44 d4rkie joined #mojo
16:49 Vandal joined #mojo
16:49 laidback_01 joined #mojo
16:54 jontaylor_ joined #mojo
16:59 dod joined #mojo
17:02 rhaen_fork joined #mojo
17:14 xaka joined #mojo
17:16 ka2u joined #mojo
17:20 good_news_everyone joined #mojo
17:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/RQh2zA
17:20 good_news_everyone mojo/master 4979cea Sebastian Riedel: removed a few comments
17:20 good_news_everyone left #mojo
18:00 rhaen_fork joined #mojo
18:02 vel joined #mojo
18:23 stephanj i got a few models which needs the application to work(db initialization plugin stuff etc), what would be the best way to make sure i can access the main app from these Models?
18:26 sivoais joined #mojo
18:41 ObseLeTe joined #mojo
18:43 rhaen_fork joined #mojo
18:46 TitanOfOld joined #mojo
19:05 * sri wonders why nobody has made a plugin for inlining images yet
19:07 sri <%= inline_image 'images/foo.png' %> and it loads the image with $app->static->file('images/foo.png')->slurp, base64 encodes, and inlines it
19:18 * sri is still interested in a fallback for pack('q<', $int) on 32bit machines btw.
19:39 rhaen_fork joined #mojo
19:41 TitanOfOld joined #mojo
19:46 yakubori joined #mojo
20:18 rhaen_fork_ joined #mojo
20:23 rhaen_fork_ joined #mojo
20:31 lukep joined #mojo
20:53 mikegrb_ I <3 MOJO
20:53 mikegrb_ https://gist.github.com/4598318
20:53 mikegrb_ frik'n 5 minutes to throw together something I expected to take 30+
20:55 mikegrb_ next I need to add a sqlite db for keeping track of which notices it has seen and maybe publication date
20:55 mikegrb_ but they do crap like:  Pub Date:January 15 & 22, 2013
21:09 xaka joined #mojo
21:12 rem_lex joined #mojo
21:14 mattastrophe joined #mojo
21:29 _xaka_ joined #mojo
21:32 good_news_everyone joined #mojo
21:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/zG6nAg
21:32 good_news_everyone mojo/master f221138 Sebastian Riedel: small optimizations
21:32 good_news_everyone left #mojo
21:49 vervain_ joined #mojo
22:07 bluescreen__ joined #mojo
22:20 xaka joined #mojo
22:31 wircus batman____:  think you're right, I've not touched the db.
22:31 wircus_ batman____:  think you're right, I've not touched the db.
22:33 wircus_ joined #mojo
22:33 batman joined #mojo
22:33 wircus hmm
22:33 wircus_ hmm
22:34 wircus_ was kicked by sri: wircus_
22:53 TitanOfOld joined #mojo
22:55 mattastrophe joined #mojo
23:13 vervain joined #mojo
23:15 vervain joined #mojo
23:25 lammel2 joined #mojo
23:41 anaio joined #mojo
23:44 jberger joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary