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

IRC log for #mojo, 2017-10-25

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

All times shown according to UTC.

Time Nick Message
00:15 vicash joined #mojo
01:10 aborazmeh joined #mojo
01:10 rickbol joined #mojo
02:21 noganex_ joined #mojo
02:22 hesperaux joined #mojo
03:54 mib_440byw joined #mojo
04:04 dboehmer joined #mojo
04:09 EvanCarroll joined #mojo
04:16 guacamole joined #mojo
04:20 irqq_ joined #mojo
04:55 VVelox joined #mojo
06:57 dod joined #mojo
06:59 inokenty-w joined #mojo
07:05 dod joined #mojo
07:17 Vandal joined #mojo
07:32 CandyAngel Will delay be replaced with promises?
08:01 trone joined #mojo
08:23 rshadow joined #mojo
08:25 prg joined #mojo
08:31 sri CandyAngel: the plan is this https://github.com/kraih/mojo/pull/1141
08:40 karjala_ joined #mojo
08:51 CandyAngel Ah, okies
08:55 sri and looking for volunteers to try https://github.com/kraih/mojo/issues/1142
09:31 karjala_ Couldn't Mojo::UserAgent have a role '+Promises' to replace get/post/etc?
09:31 karjala_ optionally
09:31 purl optionally is what stevan is thiknking
09:48 marcus karjala_: clearly it could, you could even write it and put it on cpan.
09:49 marcus sri: I've been using signatures in some of our microservices recently, it works pretty well.
09:49 sri i know core signatures work well, we need to find out if Filter::signatures works well for backcompat
09:50 marcus one thing I think could have been easier is .ep support tho, plugin('EPRenderer' => {template => {prepend => "use experimental 'signatures';"}});
09:50 marcus I've forked out Filter::signatures, I noticed there's a typo in the pod ( Simplictic?)
09:51 marcus simplicistic even
09:56 marcus I'll try it out a bit more this evening
10:15 dim0 joined #mojo
10:19 dim0 Hi! Is it right behaviour? paste.scsys.co.uk/565573
10:20 CandyAngel dim0: What happens if you change 'stash' to 'param'?
10:27 CandyAngel Actually
10:27 pink_mist dim0: I don't think it's the right behaviour, no
10:27 CandyAngel 'path' is a reserved stash name, so you need to change that
10:27 pink_mist ah, might be related to that then
10:28 CandyAngel It's not, I just changed it to 'somepath' and the 'a' is still removed for '//a/b/c'
10:30 CandyAngel Might be a security thing, because "//hostname/" is a UNC path?
10:32 dim0 I don't know, that is because I ask)
10:33 dim0 But you can't open http://web.site//a/b/c and get "a/b/c" stashed via placeholder
10:33 CandyAngel Mhm, I understand :)
10:33 pink_mist dim0: the get command is a proper user agent ... it can connect to any host
10:34 pink_mist the ./app.pl get command that is
10:35 CandyAngel http://web.site/%2fa/b/c actually works, even though Mojo::Path says it is treated the same as /
10:35 CandyAngel I don't know if it goes through Mojo::Path though
10:38 sri mojo get -v 'mojolicio.us//a/b/c'
10:38 sri it's perfectly fine
10:39 CandyAngel That redirects me to http://mojolicious.org/b/c
10:39 dim0 sri, why?
10:39 purl i guess sri, why is this hard to fix?
10:40 sri because //a/b/b doesn't mean what you think it means, like CandyAngel said
10:40 sri a is a hostname
10:41 dim0 mojo get -v 'mojolicio.us//a/b/c' -> Location: http://mojolicious.org/b/c
10:41 dim0 mojo get -v 'mojolicio.us///a/b/c' -> Location: http://mojolicious.org/a/b/c
10:41 dim0 mojo get -v 'mojolicio.us/a/b/c' -> Location: http://mojolicious.org/a/b/c
10:41 CandyAngel Mhm, triple leading slash isn't a UNC path
10:41 sri you're mixing up very different things now
10:42 CandyAngel You should be giving it an URL relative to whatever (in your case, root), so 'example.org/a/b/c' is the correct way, I think
10:43 CandyAngel But I can see the confusion, it might not be a path to your app, so it looks like Mojolicious is "mangling it"
10:46 CandyAngel dim0: It even works if you change the path a little
10:46 CandyAngel get '/search/*somepath' => sub {};
10:46 CandyAngel ./app.pl get '/search//a/b/c/' works
10:47 CandyAngel $ ./dim0.pl get '/search//a/b/c' 2>/dev/null
10:47 CandyAngel /a/b/c
10:49 dim0 okay, thanks. Seems I need to read a little bit more about paths
10:54 CandyAngel dim0: Hope that helped :P
10:55 tchaves joined #mojo
11:04 aborazmeh joined #mojo
11:39 aborazmeh joined #mojo
11:58 dim0 I found why it doesn't work for mojolicious as I expected
11:59 dim0 That is because string "GET //a/b/c HTTP/1.1"  is being parsed as URL
11:59 dim0 so "a" from "//a" becomes a hostname
12:06 dim0 It is in Mojo::Message::Request::extract_start_line
12:07 dim0 I don't know it is right behaviour or not, but it is how it works
12:15 dim0 according to rfc it is possible to ask for domain in request-target https://tools.ietf.org/html/rfc7230#section-5.3.2
12:16 dim0 but https://tools.ietf.org/html/rfc3986#section-4.3 tells that scheme is required
12:17 dim0 may be there exists another rfc which makes scheme not required
12:17 dim0 so, for me it looks like bug
12:20 pink_mist I agree
12:31 gizmomathboy joined #mojo
12:33 maschine couldn't you change your route to get '//*path' =>  ?
12:33 maschine that's how I would have expected it to work as well - if you have a route that matches parameters, and you have a '//
12:34 maschine er, a '//', it's like you passed it a blank parameter
12:44 perlpilot joined #mojo
12:48 tcohen joined #mojo
13:25 rshadow joined #mojo
13:27 pink_mist maschine: that's not how the * placeholder works
13:28 Pyritic joined #mojo
13:33 aborazmeh joined #mojo
14:31 gizmomathboy joined #mojo
14:37 gryphon joined #mojo
14:43 marax joined #mojo
14:44 marax Hi, I am new to Mojolicious. Is there a way to start an external (bash) script from inside a Mojolicious application ?
14:45 ChmEarl joined #mojo
14:48 dotan_convos marax: look at http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Subprocesses
14:49 dotan_convos And inside your subprocess, use system() or something to wrap your script.
14:50 dotan_convos Maybe with Capture::Tiny to grab the output/error streams
14:51 marax Ok. Thanks. I will try
14:51 genio Capture::Tiny++
15:19 dim0 joined #mojo
15:19 sri hmm, no review of the promise branch yet
15:19 sri but i feel confident enough to merge it
15:20 sri so, i think i'll do that later
15:49 rick_soc1 joined #mojo
15:56 rick_soc1 (-_-) c[_]
15:59 jberger sri: given that catch overloads the Mojo::EventEmitter catch, I'm inclined to recommend wrapping the catch callback to provide the invocant as a long-term fix
15:59 jberger ie, basically the patch I suggested yesterday but without the deprecation
16:05 sri jberger: -1
16:05 purl -1
16:05 jberger any reasoning?
16:06 sri it's ugly as hell
16:07 jberger its two easy to read/understand lines
16:07 sri no, it's inconsistent garbage
16:08 jberger I'm glad I'm keeping the tone pleasant
16:08 jberger ok, well break user's code. my conscience is clean
16:09 sri jberger: i'm not seeing people voting for your proposal
16:10 Grinnz I agree with jberger, there's potential for breakage
16:10 jberger it isn't potential for breakage, it is breakage. Issuing false negatives in exception handling
16:10 sri Grinnz: you think it is right to have one method in the promise api get different arguments than all the others?
16:11 Grinnz There are a few solutions, but at the very least this needs to be loudly documented in the changelog that all usage of ->catch on delays could now be broken
16:12 sri Grinnz: that was my proposal, which jberger is fighting
16:12 Grinnz I don't see any proposals
16:12 sri i want to document it very prominently, as it is strictly not a breaking change by our rules (completely untested)
16:12 jberger bad rule
16:12 Grinnz Users will see it as a breaking change, and that it can break silently is worse
16:13 jberger there is no way a user could know that that wasn't a "feature" by our standards and I know that because you didn't know
16:13 sri ok, my official stance https://github.com/kraih/mojo/pull/1141#issuecomment-339384407
16:14 jberger batman / marcus (tempire / crab): we need a real vote here
16:15 CandyAngel Would the deprecation approach involve doing different things depending on the object it gets?
16:16 sri invocant is always the same
16:16 Grinnz I believe it would involve catch taking the invocant, until the deprecation cycle is complete
16:16 sri deprecation would break it twice
16:16 sri basically, for 3 months nobody could use ->catch
16:16 Grinnz it would essentially be deprecating this version of catch, so a new one could be added
16:17 sri people would switch away for 3 months, and then they can switch back
16:17 jberger at this point I'm ok with that, call me a flip-flopper if you want
16:17 CandyAngel Oh right, so you mean like having catch_promise and catch_delay and deprecating 'catch', then deprecating those two and making 'catch' again?
16:18 Grinnz no, just old deprecated catch, you would switch to using ->then(undef, $catch_sub)
16:18 sri disclaimer, the other day jberger was ranting at me for proposing to double break :p
16:18 CandyAngel :P
16:18 jberger to be fair, I was doing that while there was no other option
16:18 jberger you were breaking the Mojo::IOLoop->delay constructor but not giving them something new to use
16:18 jberger in this case there IS something new they could use
16:19 jberger and they are getting all kinds of new benefits of the new patterns (which I want them to have)
16:19 sri https://image.cagle.com/104157/373/104157.png
16:19 jberger fuck it, I'm out
16:20 jberger I've never said a damn thing that deserved personal attacks on this.
16:20 gizmomathboy joined #mojo
16:21 sri no personal attack intended
16:21 jberger well it arrived all the same
16:21 sri disagreeing in good fun
16:21 jberger this isn't your fault, you can't know, but this is the wrong day
16:21 sri yu told me to call you a flip flopper
16:21 sri ok
16:23 CandyAngel On an unrelated (not still Mojo-related note, for once), I've tried passing non-rectangular data to tablify.. just can't remember why.. (in reference to https://github.com/kraih/mojo/pull/1132).
16:23 CandyAngel I think it was from a CSV export I was parsing for work
16:23 sri for the record, i think your concern is valid, i'm just disagreeing with the proposed solution
16:24 jberger ok, is there a solution you would tolerate?
16:24 sri to me documentation is a solution
16:24 jberger the error still essentially comes via the error event right? the events are still the same I think
16:25 sri no
16:25 jberger :o
16:25 sri catch is delivered as rejected promise, independent of the error event
16:25 sri completely independent
16:25 jberger the error event doesn
16:25 jberger sorry, the error event doesn't fire at all?
16:26 sri it does, but it's independent
16:26 sri technically it will fire before the promise gets rejected
16:26 jberger ok, you scared me there for a second :-P
16:26 sri since the promise rejection is delayed until next_tick
16:26 dim0 joined #mojo
16:26 sh14 joined #mojo
16:27 sri the error event however is specific to steps
16:28 sri for pure promises it does nothing
16:28 jberger ok, with that established, is catch a defined method in the promise/a+ spec, is that why there is contention?
16:29 sri js spec
16:29 sri https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
16:30 sri the idea is to have intuitive ->then->then->catch->finally chains
16:31 jberger but then can take a reject handler right? I mean that's how catch is implemented in the PR
16:31 jberger so ->then(sub{})->then(sub{}, sub{})->finally works
16:32 jberger anyway, the reason I asked about the error event is that catch is documented explicitly as subscribing to the error event: http://mojolicious.org/perldoc/Mojo/EventEmitter#catch
16:32 sri you want to propose to remove ->catch?
16:32 jberger from ::Delay
16:32 jberger I can accept even removing it from ::EventEmitter if that is more palatable
16:32 jberger but I don't prefer it
16:33 sri oh, it would 100% get deprecated the second we remove Delay::catch
16:33 sri i won't have people accidentally call ->catch on promises
16:33 sri because *they all* learn it from js
16:34 sri *that* would be really dangerous
16:36 sri so, the way i see it, if jberger gets the votes, i will remove Mojo::IOLoop::Delay::catch permanently, and deprecate Mojo::EventEmitter::catch
16:37 sri if i get the votes, we get a complete promise api, and i will document the possible breakage prominently
16:37 jberger it isn't my favorite solution but I'd rather have that then false-negatives
16:38 sri CandyAngel: if you care about the tablify thing get involved and make it happen
16:40 EvanCarroll joined #mojo
16:43 jberger "i won't have people accidentally call ->catch on promises" <-- do you see the promise portions of Delay inherently different than the steps portions?
16:48 sri yes
16:49 sri look at the code, they are only connected in that steps resolve/reject the promise when they are done
16:49 sh14|2 joined #mojo
16:49 sri don't even think about proposing to split them completely
16:53 dotan_convos joined #mojo
17:01 sh14 joined #mojo
17:06 dod joined #mojo
17:08 CandyAngel sri: Mhm, I will ^_^
17:08 rick_soc1 I agree with whatever CandyAngel says
17:09 karjala_ joined #mojo
17:09 CandyAngel I'm sure that's not dangerous at all!
17:10 ladnaV joined #mojo
17:11 sri CandyAngel: maybe start with making the patch use less lines of code
17:12 CandyAngel Of course :P
17:18 sri hehe, i can golf it down to 2 lines, so same as before :p
17:19 CandyAngel So is this just like an interview challenge for me?
17:19 CandyAngel :P
17:19 sri the whiteboard is over there :p
17:20 rshadow joined #mojo
17:22 Vandal joined #mojo
17:24 CandyAngel OKay but you have to stop looking at it otherwise by the time I'm done, you'll have the whole thing at 2 lines :|
17:24 trone joined #mojo
17:24 sri haha
17:25 sri i just did it because you made me look at the patch and it was so obvious :S
17:25 CandyAngel :P
17:47 itaipu joined #mojo
18:09 sri do, does anyone have an idea for how to add Filter::signatures support to Mojo::Base?
18:10 sri re https://github.com/kraih/mojo/issues/1142
18:20 karjala_ someone had mentioned this yesterday: https://metacpan.org/pod/Import::Into
18:20 karjala_ probably useless, sorry
18:26 CandyAngel Apparently I am just as bad at Perl golf as real golf :P
18:31 CandyAngel I make some changes and the test suite fails but I can't tell why (the 'got' and 'expected' look the same)
18:32 dantti_laptop joined #mojo
19:02 sri whitespace
19:02 sri trailing space somewhere prolly
19:07 pink_mist I've also gotten bitten by space vs tab issues
19:11 gizmomathboy joined #mojo
19:11 good_news_everyon joined #mojo
19:11 good_news_everyon [mojo] kraih pushed 1 new commit to promises: https://git.io/vFvSY
19:11 good_news_everyon mojo/promises 93eff35 Sebastian Riedel: _die is not used anymore
19:11 good_news_everyon left #mojo
19:11 sri finally someone actually looked at the code!
19:22 batman https://github.com/kraih/mojo/pull/1141#discussion_r146952342 <-- did you see this comment?
19:23 batman looks like removing _die() marked it as outdated.
19:24 jberger yay github
19:25 * batman continues packing
19:25 jberger batman: where are you going?
19:26 batman hong kong :)
19:26 jberger wow! have fun!
19:26 batman or... asia... i land in hong kong. going to visit some friends in shenzhen and then i don't know what to do.
19:30 jberger shenzen looks wild
19:44 batman i think it'll be an experience :)
19:46 rick_soc1 are you staying just in Hong Kong
19:46 rick_soc1 or could you be making other flights?
19:47 batman rick_soc1: going to travel around, but most of the time will be in shenzhen and the where i can reach by train.
19:47 pink_mist he specifically said he was _not_ staying just in hong kong :P
19:48 batman hopefully going to another country and a beach as well.
19:50 batman Not a huge beach person, but I do enjoy water.
20:13 EvanCarroll joined #mojo
20:23 sri shocker, norwegian enjoys water :)
20:31 batman haha
20:36 batman Not crazy like my friends who jump in during Christmas, when it’s 10C 😳
20:42 Phil21 when did iterm2 starting inserting icons into text
20:42 Phil21 lame
20:42 Phil21 like :) is now an icon to me
20:42 Phil21 hmm, maybe not.  batman got me.
20:43 Phil21 noticed a few other unicode icons today I never did before too (key when typing in ssh passphrase for example on osx)
20:45 batman :)
20:45 batman that icon-smiley came from the phone emoji keyboard
20:47 rick_soc1 🐧
20:56 Grinnz 😄
20:56 Grinnz it only works for actual emoji, probably
21:00 genio right. only _actual_ emoji show up
21:00 genio which is correct behavior
21:01 sri 🤓
21:02 good_news_everyon joined #mojo
21:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFvjb
21:02 good_news_everyon mojo/master bbe18c3 Sebastian Riedel: Merge pull request #1141 from kraih/promises...
21:02 good_news_everyon left #mojo
21:03 pink_mist \o/
21:03 pink_mist sri++
21:04 sri the core of it passed all reviews, just minor details still up for discussion
21:05 sri worst case Mojo::IOLoop::Delay::catch gets removed and Mojo::EventEmitter::catch deprecated
21:07 jabberwok joined #mojo
21:07 jabberwok left #mojo
21:31 itaipu joined #mojo
21:38 EvanCarroll joined #mojo
21:48 sri oops
21:48 sri i think i just fixed a huge bug in the code is stole from Promises :S
21:49 sri that's awkward
21:49 sri s/is/i/
21:53 good_news_everyon joined #mojo
21:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFfIs
21:53 good_news_everyon mojo/master 9190e88 Sebastian Riedel: fix rejection chains
21:53 good_news_everyon left #mojo
21:53 sri apparently Promises can't propagate rejections
21:54 sri which is required by Promises/A+
21:54 Grinnz that seems... important
22:00 good_news_everyon joined #mojo
22:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFfLG
22:00 good_news_everyon mojo/master e56d60b Sebastian Riedel: update Changes
22:00 good_news_everyon left #mojo
22:09 sri well, i'm giving back :) https://github.com/stevan/promises-perl/issues/73
22:45 EvanCarr1ll joined #mojo
23:26 mohawk boom ;-)

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