The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-10-12

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

All times shown according to UTC.

Time Nick Message
00:33 alilles joined #mojo
00:34 stein joined #mojo
00:43 hesperaux joined #mojo
02:35 noganex joined #mojo
03:57 inokenty-w joined #mojo
04:04 dboehmer joined #mojo
04:46 aborazmeh joined #mojo
05:52 trone joined #mojo
06:06 dod joined #mojo
06:07 dod joined #mojo
06:37 prg joined #mojo
06:54 AndrewIsh joined #mojo
07:12 bianca joined #mojo
07:12 Vandal joined #mojo
07:14 bianca Hey! I'm setting session variable 'username' in Test::Mojo::Session like in the docs, but I would like to have a custom function, that does not set username to a constant, but to a variable (something like calling get_ok('/set/my_username') for example?) Do you know how to do that or if it's even possible?
07:50 trone joined #mojo
08:00 bianca joined #mojo
08:06 batman bianca: get '/set/:uid/' => sub { my $c = shift; $c->session(username => $c->stash('uid')) }
08:06 batman sounds like a security hole though
08:07 bianca batman thanks! After getting disconnected I wasn't expecting an aswer anymore :))
08:07 bianca why is it a security hole?
08:07 bianca (it's just in the tests)
08:08 batman the username in the session should only be set from the server side imo, not based on user input directly
08:08 bianca yeah I get why it would be otherwise. but those routes are defined in test cases
08:09 bianca so real users don't get access to those. It's just to set users in tests
08:13 rba joined #mojo
08:14 sri Test::Mojo::Session should really be a role
08:17 bianca sri what do you mean by role?
08:17 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Testing#Extending-Test::Mojo
08:27 good_news_everyon joined #mojo
08:27 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/vdKDf
08:27 good_news_everyon mojo/master a35e20a Sebastian Riedel: just say exited
08:27 good_news_everyon mojo/master fea3ef0 Sebastian Riedel: bump version
08:27 good_news_everyon left #mojo
08:27 good_news_everyon joined #mojo
08:27 good_news_everyon [mojo] kraih tagged v7.47 at 31a7131: https://git.io/vdKDJ
08:27 good_news_everyon left #mojo
08:34 bianca sri could you elaborate? I'm not sure how I can use Role to set the session variable that I need
08:34 sri you can't, i'm saying Test::Mojo::Session is not a good module
08:35 bianca oh
08:35 bianca how do you use role to test session then?
08:35 bianca if controller methods use session for getting user information
08:36 bianca or you were not saying that either?
08:36 sri i wasn't
08:37 bianca ok then, going back to session
08:38 rshadow joined #mojo
08:40 sri there are fairly easy ways to access the session from tests
08:41 sri like a hook that stores the session in a variable
08:42 petru joined #mojo
08:42 sri but do whatever works for you, i'm mostly talking to whoever writes Test::Mojo::Role::Session now
08:55 karjala_ joined #mojo
09:22 aborazmeh joined #mojo
09:22 margeas joined #mojo
09:46 irqq joined #mojo
09:50 dod joined #mojo
10:36 petru joined #mojo
10:57 jamesaxl joined #mojo
12:14 pirateFinn joined #mojo
12:31 hertzhaft joined #mojo
12:46 kes joined #mojo
12:58 sri mst just asked me if this should copy @_ before downgrading, and i think he might be right https://github.com/kraih/mojo/commit/0c478792e1229841a11e7e54a18ca48bd80b3d11#diff-23288abbf7581bb56bb0af7b60e03593R83
13:06 sri and i suspect that will affect performance very negatively
13:11 genio sri: A copy shouldn't affect performance that badly when it's such a simple set of possibilities of data in there, should it? a shallow copy should be fast enough
13:13 sri perl -Ilib -Mojo -E 'n { Mojo::File::path("foo", "bar", "baz") } 1000000'
13:13 sri 1.7s vs 1.4s
13:14 sri 735294.12/s
13:14 sri 588235.29/s
13:14 genio oh, wow.
13:15 marcus hmm,  not exactly free
13:15 sri https://gist.github.com/anonymous/6c5c948865f24d1650a5d927d0b58dd3
13:15 sri my quick hack
13:16 sri Perl 5.26.1
13:20 genio Well, a dumb question, does Mojo::File->new() get called frequently enough in most apps for that to actually cause a problem?
13:21 genio it's certainly a slowdown, but how frequently does one make a million Mojo::File->new() calls?
13:48 ChmEarl joined #mojo
14:09 tcohen joined #mojo
14:09 mib_1jdrkd joined #mojo
14:10 jberger I guess the rps concern is for Mojo::Static?
14:10 jberger other than that I don't see a whole lot of problem slow Mojo::File down a little bit
14:17 sri Mojo::File is used all over the place
14:18 sri stuff like Mojo::File::list creates a Mojo::File object for every result
14:18 sri at work i actually do create a few thousand that way
14:18 genio ah.
14:23 nchelluri joined #mojo
14:28 gryphon joined #mojo
14:33 gryphon joined #mojo
14:39 jberger hmmmm good point
14:40 jberger could you downgrade the path when it is used rather than when the object is created?
14:40 jberger yes that would mean lots of repeated code
14:40 jberger but its "pay for what you use"
14:43 ilbot2 joined #mojo
14:43 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
14:44 tcohen joined #mojo
14:47 zach joined #mojo
15:42 gryphon joined #mojo
15:47 hertzhaft joined #mojo
15:51 sri jberger: it is used right there!
15:51 sh14 joined #mojo
15:52 sri ... if -d path('foo', 'bar', 'baz')
15:52 sri there is no step in between
16:02 Grinnz yeah, i dont see any way to avoid the penalty
16:02 jnbek joined #mojo
16:31 gryphon joined #mojo
16:50 rba joined #mojo
16:55 itaipu joined #mojo
17:09 dod joined #mojo
17:15 cheako joined #mojo
17:21 maschine joined #mojo
17:42 rshadow joined #mojo
17:43 maschine happy 30th birthday Perl :p
17:43 trone joined #mojo
17:55 cheako joined #mojo
17:58 petru joined #mojo
18:03 rba joined #mojo
18:09 rshadow joined #mojo
18:22 irqq joined #mojo
18:49 mohawk joined #mojo
19:56 gryphon joined #mojo
20:09 petru joined #mojo
20:19 karjala_ joined #mojo
23:51 genio I've reached out to the libuv dev team for help finding out what kind of stupid we've got going on with UV
23:51 genio hopefully they'll be able to help smooth out some of the edges

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