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

IRC log for #mojo, 2016-11-25

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

All times shown according to UTC.

Time Nick Message
00:10 mishanti1 Running `Mojo::IOLoop->one_tick;` immediately before I check the database seems to solve it.
00:18 cstamas joined #mojo
00:24 jontaylor joined #mojo
00:30 mattp_ joined #mojo
00:58 aborazmeh joined #mojo
01:00 jontaylor joined #mojo
01:12 mishanti1 Hurr di durr. I'm full of derp today. Throwing $ioloop->one_tick all over the place gave random 'double free or corruption' crashes. Think I need to sleep, then re-read the mojolicious documentation.
01:15 pink_mist (and stop putting ->one_tick randomly - it's not something to sprinkle about willy-nilly)
01:17 mishanti1 pink_mist: Yeah, the docs had a warning about doing that. :) What I need to do is figure out how I in my test-file can wait until I am sure that the delay-steps set up in my after_dispatch all have been executed.
01:51 Paddi joined #mojo
03:28 noganex joined #mojo
04:19 parv joined #mojo
05:04 dboehmer joined #mojo
05:38 inokenty-w joined #mojo
06:29 tyldis mishanti1: You don't trust transactions for the test?
06:35 dod joined #mojo
07:21 Paddi joined #mojo
07:59 ashimema joined #mojo
08:09 mbudde joined #mojo
08:13 mishanti1 tyldis: Not sure I follow. Trust transactions how?
08:19 rshadow joined #mojo
08:21 CandyAngel So, I can actually attemp to install 7.10 at work
08:22 CandyAngel but websocket_proxy.t fails, then the test goes into an endless loop
08:22 trone joined #mojo
08:23 CandyAngel right_content gets '' instead of the example url
08:23 tyldis mishanti1: You wanted to verify that something got inserted into the database, right?
08:23 tyldis In my mind you would use transactions, and only issue the 200-response once the transaction was complete
08:24 tyldis Just curious about your use-case since you wanted to perform a test for it
08:25 mishanti1 tyldis: Yeah absolutely, for most things at least. But this is an action that is to take place after the request has been processed and sent back to the client, hence using the after_dispatch-hook.
08:27 AndrewIsh joined #mojo
08:30 tyldis Ok, cool. You seem to know your stuff, and that peeked my curiosity.
08:32 dod joined #mojo
08:33 CandyAngel It seems to be failing on line 166, cant find 'send' on the $tx
08:39 dod joined #mojo
08:40 mishanti1 tyldis: Thanks for the vote of confidence, but I'm just an amateur dabbling. :) And right now I'm at a loss.
08:41 eseyman /win 1
08:46 mishanti1 I did think that I from my tests could add another after_dispatch-hook that emitted an event that I could subscribe to in the tests that would somehow signal that the hook under test was indeed done, but then I reread the docs and they talk about "out of order execution". That makes me suspect that I'd be back at square zero.
08:53 CandyAngel I think I figured out what is happening..
08:54 CandyAngel sri: jberger: are the tests failing into infinite loop ever acceptable?
08:56 rshadow joined #mojo
09:35 parv joined #mojo
09:56 sugar joined #mojo
10:16 mib_cj3d8t joined #mojo
10:18 mib_cj3d8t I want to sycnrhonize some code with ->delay->begin, but the code in question is sync-based ( Moose-ish lazy _build_* callbacks )
10:18 mib_cj3d8t how crazy is it to local $Some::Global::Var = current ioloop->delay object in scope, and if the var is present do begin...->() in the builders themselves?
10:23 alexbyk joined #mojo
10:24 sri very crazy
10:24 sri CandyAngel: no
10:25 mib_cj3d8t sri: what would you recommend then?
10:25 mib_cj3d8t is there a cookbook type thing for this kind of use case?
10:27 pink_mist maybe have the _build_foo builder use a callback you set on the object - which could close over your current delay
10:29 sri the simple answer is that you just don't do it
10:32 sri only way to do it properly is coroutines, and we don't have reliable ones in perl currently
10:33 sri so, don't mix non-blocking code into blocking code
10:34 sri (you can mix blocking code into non-blocking code somewhat though, you just have to make sure not to block for too long)
10:35 mib_cj3d8t deep down inside the builders are async, yet sequential (with inner delay chains)
10:35 mib_cj3d8t anyway I will go with what pink_mist suggested
10:35 sri listen, you can't do that
10:36 sri or ignore me and build a house of cards that will come crashing down on you at some point in the future
10:36 mib_cj3d8t house of cards it is ;)
10:46 jontaylor joined #mojo
11:04 tchaves joined #mojo
11:14 gregf_ joined #mojo
11:18 jontaylor joined #mojo
11:52 cpan_mojo Mojolicious-Plugin-Vparam-1.19 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-Vparam-1.19
11:55 CandyAngel sri: I think if the proxy websocket is intercepted and dropped, it causes the test to fail into an infinite loop on line166 of websocket_proxy.t
11:59 rs1 joined #mojo
12:51 asarch joined #mojo
13:15 Paddi joined #mojo
13:38 abra joined #mojo
13:53 zivester joined #mojo
13:58 ramortegui joined #mojo
13:59 CandyAngel sri: http://codepad.org/8JuMuQvf
14:02 dod joined #mojo
14:07 jberger mishanti1: it sounds like you want the transaction's finish event not the after_dispatch hook
14:07 Jonis oo
14:12 good_news_everyon joined #mojo
14:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1UXB
14:12 good_news_everyon mojo/master c327a65 Sebastian Riedel: update mod_proxy example for Apache 2.4
14:12 good_news_everyon left #mojo
14:12 sri CandyAngel: yea, that doesn't tell me anything
14:14 mishanti1 jberger: Great idea. Will definitly try that out. Though, the tests actually did run successfully and consistently by putting `Mojo::IOLoop->delay(sub{ Mojo::IOLoop->timer(0 => shift->begin) })->wait;` immediately before I check for data existence.
14:19 mishanti1 jberger: But to double-check: you propose that in eg. a bridge for the endpoint that we want to do this logging / bookkeeping we insert $c->tx->on(finish => sub { ... }); , instead of relying on the after_dispatch hook?
14:32 jberger mishanti1 timer 0 is basically just next_tick
14:32 jberger And a delay with wait just guarantees that the loop is running
14:33 mishanti1 jberger: I did in fact try with next_tick, but that also produced random failures for me. The snippet above produces none, but to be honest I have no idea why it works. :)
14:33 jberger I mean if that works for you then fine, but I try to avoid hooks if I can, just a personal preference thing
14:35 jberger "that" in the last message was meant to mean the hook
14:35 mishanti1 jberger: Well, if you try to avoid it then I am guessing there is a well thought our reason behind it. I will try your transaction approach instead and see where that leads me.
14:35 mishanti1 "avoid it" being "avoid hooks"
14:36 jberger Hmmm convos isn't being so nice on hotel wifi
14:36 jberger I wonder if they block websockets?
14:38 mishanti1 jberger: Might be you're experiencing the same thing I experience on hotels here in Norway: dns-intercepting and ssl-mitm. Sometimes this causes random pieces of a stack to freak out.
14:38 pink_mist 0_o ssl-mitm? 0_o
14:38 mishanti1 I have guessed that they do this so they can inspect "deeper" what people are doing, and then block unwanted / unlawful traffic.
14:39 pink_mist isn't ssl supposed to stop mitm from being possible (ideally)
14:43 mishanti1 pink_mist: Not really, but I guess some people would like it to. SSL is good for securing the connection, but that does not help you one bit if the party you are talking securely to are someone other than who they appear to be.
14:43 pink_mist mishanti1: which is what SSL is supposed to ensure; that they are who they appear to be
14:43 ashimema joined #mojo
14:52 tyldis To do transaprent SSL proxying, which included MITM, they need to have certs from a CA you trust. Not possible for a hotel.
14:52 pink_mist exactly
14:53 tyldis But perfectly doable for an employer with control over the machines where they inject trust to their own CA
14:53 pink_mist that's true enough
14:54 tyldis Which is why some think it's smart to do certificate pinning
15:04 dod joined #mojo
15:16 jberger I suspect it's less nefarious than ssl-mitm
15:16 jberger Just bad/cheap network
15:19 tyldis And idiots torrenting ;)
15:23 disputin joined #mojo
15:23 vicash tyldis, pink_mist: a hotel can install an SSL MITM server that can transparently proxy such as that by BlueCoat https://bto.bluecoat.com/webguides/proxysg/security_first_steps/Content/Solutions/SSL/ssl_solution.htm
15:24 vicash tyldis, pink_mist: also a sysadmin can install sslsplit https://www.roe.ch/SSLsplit to intercept the SSL
15:25 vicash tyldis, pink_mist, mishanti1: your best bet is to use a VPN at all times when you're not on your own network.
15:25 vicash an easy way to setup VPN is to purchase a VPN service from the various non-logging VPN services, or to setup your own with one certificate for each of your devices on EC2 or Digital Ocean or Linode or whatever service you want to use.
15:26 vicash this can also protect you from your own ISP logging your DNS queries
15:26 vicash and doing deep packet inspection
15:27 vicash Trail of Bits provides a quick setup example with their IPSec VPN https://github.com/trailofbits/algo
15:33 sugar joined #mojo
15:51 vicash jberger: you may want to  buy an external wifi card like Alfa, it really works.. i have a 9dbi antenna and even though it is big it provides faster speeds on wifi networks with low signal  https://www.amazon.com/Alfa-AWUS036NH-802-11g-Wireless-Long-Range/dp/B003YIFHJY/ref=sr_1_5?ie=UTF8&qid=1480088936&sr=8-5&keywords=alfa+awus036nha
15:52 pink_mist only 11g?
15:52 purl only 11g are used.
15:53 pink_mist oh, hmm, it says it's compatible with n too
16:17 vicash pink_mist: i have two of these, one for a/b/g and one for b/g/n... they work with linux which was my primary requirement
16:34 tyldis vicash: You still need to have the device trust the proxy. Or else you will get a warning on the device. Of course, most people will just curs the damn intarweb and bypass it. Luckily, Chrome makes that harder to do by each release.
16:35 tyldis vicash: to quote your own link " SSL interception works by having the client establish a trust relationship with the appliance", meaning enterprise environment where the company can inject the necessary CA trust
16:36 tyldis But this is getting besides #mojo charter ;)
16:37 disputin joined #mojo
16:40 PryMar56 joined #mojo
16:57 vicash tyldis: yes. i agree, and this is my last comment on this topic for now to end the chatter - hotels generally provide a screen for you to accept terms and conditions... most of them are too cheap to employ bluecoat so i wouldn't worry that much.. however, i will still recommend VPN for non-personal networks
17:00 rshadow joined #mojo
17:04 kes joined #mojo
17:08 [vlad] in mojo when i have an error it helpfully brings up a nice debug screen highlighting the error.  how would i get it to show the calling sub as well as the sub with the error?
17:08 pink_mist press the 'show more' button
17:08 [vlad] damn
17:08 CandyAngel sri: Sorry, not sure what you need. I just know the software on the work machine intercepts and drops HTTP proxy connections (happens if I have http_proxy set for CPAN too), and the test freaks out on the proxied HTTP connection.. so I think that is the cause
17:09 [vlad] that was easy
17:10 kes Is there a way to use morbo to run applications by symlink to it?
17:10 kes http://paste.scsys.co.uk/539906
17:24 sri CandyAngel: :S http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#Do-I-need-to-clean-my-environment-before-testing-Mojolicious
17:25 CandyAngel I don't think there is any strange environment stuff, but I will check on Monday, thankies
17:26 sri you just said there's weird stuff!!!
17:26 CandyAngel Yeah, not in the environment, it's MITM at the TCP level
17:26 CandyAngel As far as I can tell
17:26 sri wtf
17:27 sri why do you even expect anything to run there?
17:27 sri what made you ask in this channel in the first place?
17:27 sri that's just messed up
17:27 CandyAngel Because it's Mojolicious test suite that is failing
17:28 CandyAngel CPAN manages to download and start installing it (and can install other packages)
17:28 sri please don't poke me again
17:28 CandyAngel Er.. okies
17:28 CandyAngel Sorry
17:30 sri it's like the 10th time you popped up with this weird stuff
17:30 sri and you make it sound like an ordinary problem at first
17:32 CandyAngel I'm sorry, I just found a corner case where you test fails in a manner you think is unacceptable and thought you'd want to fix it
17:32 CandyAngel If not, that's fine. It's a corner case
17:32 sri nope, in this case however it fails is acceptable :)
17:33 CandyAngel Well, that is why I asked: are the tests failing into infinite loop ever acceptable?
17:33 sri just like i don't care how it fails if there's broken ram sticks ;p
17:34 CandyAngel Okies
17:44 CandyAngel Just.. please don't be annoyed with me continuing to speak to you about it, when you lead me to by saying it isn't ever acceptable for the test to get stuck..
17:45 sri i should have known better, your problems are never straight forward :)
17:45 CandyAngel That's true :P
17:46 CandyAngel I'll be more prudent with bringing them here in the future
17:46 CandyAngel Try to, at least
18:03 CandyAngel One last question about it, I guess. Would you be interested in a patch to the test suite which avoids the behaviour I get?
18:04 sri it would have to be cleaner than the current code
18:07 CandyAngel Okie, I'll have a go and do a PR if I come up with something you might find acceptable
18:22 sugar joined #mojo
18:44 rshadow joined #mojo
18:46 mishanti1 vicash: I carry with me my trusty AWUS036NHA at all times. Truly magnificent card.
19:05 laidback_01 joined #mojo
19:06 alexbyk joined #mojo
19:35 dod joined #mojo
20:22 abra_ joined #mojo
20:25 abra joined #mojo
20:27 kes Is that OK that 'link_to' helper for this route '+/:id  DELETE  "delete_user"' did not append '_method=delete' as 'form_for' does?
20:27 sri not sure what else to say about this https://github.com/kraih/mojo/issues/1016
20:29 sri gonna call this a bug https://github.com/kraih/mojo/issues/1011
20:29 sri some socket/timing shenenigans on windows
20:35 jberger Re 1016, does send+hashref do any encoding?
20:35 jberger IIRC only send+string does
20:37 rshadow joined #mojo
20:40 kes The resource delation does not require other data than :id. This is sufficient. But I am required always to have form to do that or forced to create extra route: +/:id/delete GET "delete_user2" ((
20:43 kes Why you do not add _method query parameter for methods other than GET or POST by 'link_to' helper'? May I request this feature? O:-)
20:51 sri looking at the python websocket example, i guess it could be interesting to extract the "blocking" websocket api from Test::Mojo
20:52 sri i mean, we've got all the basics already there, hidden behind test methods
20:52 abra_ joined #mojo
20:53 sri my $ws_container = $ua->websocket('ws://foo/bar'); $ws_container->send('...'); my $msg = $ws_container->recv;
20:53 sri it would use $ua->ioloop, like all the other blocking versions
20:55 sri one more possible project for suse hackweek :)
21:01 mishanti1 sri: The suse-engagement is still pleasant I take it?
21:03 sri yea, now working from my home office :)
21:04 mishanti1 Good that you found something that was a good match for you. How do you find working from home? Don't miss going into an office meeting other sacks of flesh?
21:07 sri i like it a lot, and nope ;p
21:08 mishanti1 :)
21:08 sri basically everyone i need to talk to regularly is on irc
21:08 sri and there's regular video conferences, even a bit too many for my taste
21:08 mishanti1 People seem to be very divided on that topic. Some people just don't function if they don't have somewhere to go where they can socialize.
21:09 sri extroverts vs introverts
21:12 jberger When I'm working synchronously with someone, I like to at least have an audio connection open
21:12 jberger Mostly if only to keep the conversation synchronous
21:12 mishanti1 I did "multiplayer emacs via ssh" a couple of times. That was actually a great deal of fun.
21:13 sri not tried sync audio yet, no clue if it would work or just pull me out of the zone
21:14 mishanti1 We used GTalk for discussions and had Emacs as the shared workspace when pair-programming. Actually a very interesting experience.
21:22 sugar joined #mojo
21:40 rshadow1 joined #mojo
22:17 AFGTips joined #mojo
22:17 AFGTips 4Try a new and reliable service of football free tips and grow your balance highly in a few days: 1,14 http://www.afgtips.com/english-version/
22:18 mishanti1 orly?
22:18 purl YA RLY.
22:19 mishanti1 Can't be.
22:50 jontaylor joined #mojo
23:23 mishanti1 Who would have thought. Bosch made an mp3 player.
23:23 mishanti1 Bosch DLE 50 Professional.
23:23 mishanti1 Never knew that existed until now.
23:27 lluad They make several "site radios" that run off their standard batteries. They're pretty nice.
23:28 mishanti1 Milwaukee has some pretty rugged audio equipment as well.

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