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

IRC log for #mojo, 2017-07-17

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

All times shown according to UTC.

Time Nick Message
01:25 yukikimoto joined #mojo
02:02 noganex joined #mojo
02:59 noganex_ joined #mojo
04:03 inokenty-w joined #mojo
04:45 schelcj joined #mojo
05:24 yukikimoto joined #mojo
05:58 schelcj joined #mojo
06:00 zach if I do something like https://gist.github.com/tempire/817998#file-gistfile1-pl but make it a login, would $t have a session that could be tested for authenticated routes?
06:10 ashimema joined #mojo
06:39 dod joined #mojo
06:42 prg joined #mojo
06:43 buggy joined #mojo
06:43 buggy Hi there good morning from Madrid
06:44 AndrewIsh joined #mojo
06:44 dod joined #mojo
06:46 buggy I don't know if this is the way it should be done. I have a form to upload and delete files.
06:46 buggy So I decided to have a get route to a directory /fh/*dir => 'fh';
06:48 buggy And I thought it was logict to have a route to delete files something like del '/fh/@dir' => sub { unlink ... bla bla};
06:48 buggy how do I reach this route from the <form> in the fh template?
06:49 buggy is <form action="delete" ...> correct?
06:50 buggy is this aproach correct at all?
06:51 AndrewIsh joined #mojo
06:55 kes joined #mojo
06:57 dod joined #mojo
07:31 trone joined #mojo
07:52 bianca joined #mojo
07:56 Vandal joined #mojo
07:56 cosimo joined #mojo
08:09 bianca joined #mojo
08:41 rshadow joined #mojo
10:26 depesz left #mojo
10:29 bianca joined #mojo
10:36 yukikimoto joined #mojo
11:48 mishanti1 joined #mojo
11:50 irqq joined #mojo
11:54 tchaves joined #mojo
11:54 gregf_ joined #mojo
12:25 gizmomathboy joined #mojo
12:31 perlpilot joined #mojo
12:46 Lee joined #mojo
12:58 dod joined #mojo
13:38 Pyritic joined #mojo
13:39 bwf joined #mojo
14:07 vicash joined #mojo
14:25 jberger zach first of all, post_form_ok is long since removed
14:26 jberger but if you instead translate to $t->post_ok($url, form => \%form_data) ... then the user agent that $t uses ($t->ua) has a cookie jar that manages its cookies (which you app uses to manage session data)
14:26 jberger I don't know what you mean by "tested for authenticated routes" though
14:27 jberger and if buggy comes back or reads the logs, many browsers don't honor action="delete" or indeed anything but action="get|post"
14:27 jberger and for that reason mojo has an override
14:29 jberger err, sorry that should of course be method="get|post"
14:29 jberger action is the target url
14:29 jberger anyway, the override is demonstrated here: see _method
14:29 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#HTTP-methods
14:29 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Forms
14:34 marty joined #mojo
14:53 dod1 joined #mojo
15:16 petru joined #mojo
15:17 Janos joined #mojo
15:27 PryMar56 joined #mojo
15:28 jabberwok joined #mojo
15:35 sh14 joined #mojo
15:48 dod joined #mojo
15:57 sri hmm, postgres 10 seems to be a bit of a boring release https://wiki.postgresql.org/wiki/New_in_postgres_10
15:58 sri i guess easy full-text search for jsonb fields is kinda neat
16:02 sri logical replication seems silly
16:02 sri everybody is waiting for master/master replication
16:03 sri it's strange, they get everything else than replication so right
16:08 genio replication is complicated
16:09 sri lets go shopping
16:10 jberger when master/master becomes easy I can finally get Phil21 off my back
16:12 jberger oh its got sharding primatives now
16:12 jberger I guess that is worth a new major version number
16:14 jberger oh, and I see that they are moving away from X.Y.Z
16:15 jberger so the next major release will be 11 not 10.1
16:15 jberger so this really is no different than 9.7 would have been
16:16 Grinnz makes more sense, with how they add new features
16:16 jberger guess that's what you do when you want to Java version yourself but your leading digit is greater than your secondary digit
16:17 Grinnz haha, java versions...
16:17 jberger once again, the argument for Perl 28
16:17 jberger the 5 is useless now, so drop it
16:18 Grinnz possible once perl 6 is using a different name
16:19 sri jberger: that's wha i've been saying for years :p
16:19 * sri wonders how many users vscode has
16:20 jberger Grinnz: totally possible now, remember, Perl vs Perl6 is not confusing, they've been saying that for years
16:20 sri at least 3 million
16:20 Grinnz Kappa
16:33 Gedge_ joined #mojo
16:41 dod joined #mojo
16:41 kgoess can you use Test::Mojo to test a controller that has a non-blocking $user_agent call in it?
16:42 kgoess it looks to me like no, because Test::Mojo methods like post_ok don't take callbacks?
17:00 Zx3_ joined #mojo
17:03 preaction kgoess: yes. after you do the post_ok, call something like message_ok
17:04 irqq joined #mojo
17:05 Gedge joined #mojo
17:07 stephan48 joined #mojo
17:08 kamyl joined #mojo
17:13 zerah joined #mojo
17:33 rshadow joined #mojo
17:36 batman marcus: https://github.com/Nordaaker/convos/blob/master/snap/build.sh
17:37 batman need to register your app as a snap first thought.
17:59 jberger preaction: that is for websockets
17:59 jberger kgoess: yes but you need to manage the loop yourself
17:59 preaction oh, right. there's other reasons to use nonblocking things in a controller
18:01 sri no, you don't
18:01 sri non-blocking just works
18:02 sri Test::Mojo runs Mojo::IOLoop->singleton
18:12 jberger hmmmm, I guess I misunderstood the question
18:12 jberger if you just want a callback to trigger non-blocking behavior then as sri says, you don't need that it should just work
18:12 jberger I assumed the question was coming because they wanted to do something with the callback
18:12 jberger my bad
18:14 kgoess with MOJO_USERAGENT_DEBUG=1, I can see the webapp making the non-blocking POST, but it's not waiting for the response, it's returning to the Mojo::Test call immediately
18:18 jberger kgoess: what does it render?
18:19 jberger ie, are you sure that you've disabled automatic rendering?
18:19 jberger $c->render_later;
18:19 kgoess yep, I put render_later just before the call to $ua->post
18:20 kgoess it's rendering the $tx->success case in the $ua's callback, which I find strange
18:20 kgoess no request is making it to the server that should be receiving the POST, I'm watching the logs there
18:21 kgoess I'll try to boil it down to a minimal test case if sri thinks it should just work
18:22 kgoess it definitely works if I stand the webservice up and hit the endpoint with, e.g. wget. it only doesn't work using Test::Mojo
18:30 trone joined #mojo
18:36 jberger kgoess: are you replacing the test instance's UserAgent with a different instance?
18:36 jberger like $t->ua(Mojo::UserAgent->new)
18:36 jberger or something like it?
18:37 jberger or else replacing the test instance's useragent instance's ioloop?
18:38 kgoess the webapp is just using my $t = Test::Mojo->new("My::Webapp") and the webapp is using $self->ua
18:38 kgoess sorry, interrupted while typing that
18:38 kgoess the test is just using my $t = Test::Mojo->new("My::Webapp") and the webapp is using $self->ua
18:40 preaction i'd reduce it to a minimal test case. that might help figure out what's the troule
18:40 jberger are you calling back into your own webapp?
18:40 preaction trouble
18:41 kgoess no, the webapp is calling out to a different service
18:41 purl okay, kgoess.
18:41 kgoess will work up a simplified test case, thanks
18:41 jberger then yeah, I think I need to see a minimal example before I can help any further
19:00 irqq joined #mojo
19:01 castaway joined #mojo
19:01 dod joined #mojo
19:10 gabiruh_ joined #mojo
19:13 sri wow, this is a good bundle https://www.humblebundle.com/books/cybersecurity-wiley
19:21 gabiruh joined #mojo
19:25 Phil21 darn, I missed an opportunity to rant about pgsql clustering I see
19:25 Phil21 stupid meetings.
19:31 plicease2 joined #mojo
19:44 Craftsmanship Am I right in understanding that Mojolicious::Plugin::Config expects me to app->secrets([ "Rofl" ]) in the config file in order to set the secrets?
19:46 Grinnz no, the config plugin doesn't care about your secrets, though you can set your secrets from your config (and many do) in startup
19:49 jberger Craftsmanship: usually it is something like `plugin 'Config`; app->secrets(app->config->{secrets}) if app->config->{secrets};`
19:50 jberger or make it unconditional I guess
19:56 Pyritic joined #mojo
19:59 bianca joined #mojo
20:01 firnsy joined #mojo
20:15 Craftsmanship Seems odd that you wouldn't want your secrets in the config by default
20:18 pink_mist Craftsmanship: why do you think that would entail having code in the config that changes your app directly instead of simply loading the config and then in the startup reading the secrets from the config and applying them?
20:18 pink_mist (would changing the app directly from the config even work?)
20:19 pink_mist Craftsmanship: YES. DO put your secrets in the config. NO. DON'T run code that would apply your secrets in the config.
20:22 irqq_ joined #mojo
20:23 Craftsmanship It sure would, indeed it goes to lengths to make sure there's an app() in scope when the file is eval'ed
20:26 Grinnz just because the perl-style config plugin allows you to change the app, doesn't mean it's a good idea
20:27 Grinnz that's pretty much the definition of footgun
20:27 Grinnz i think the app being in scope is more in case you wanted to *read* properties of it
20:27 Grinnz like moniker or something
20:46 S joined #mojo
21:12 sri app->home->child(...)
21:15 karjala_ joined #mojo
21:25 Craftsmanship Grinnz: that's a better reason for something crazy like that to be there
21:29 Craftsmanship https://rethinkdb.com/blog/2.3.6-release/ Community!
21:29 gryphon joined #mojo
21:30 arcanez is that one worth looking into and using?
21:31 Craftsmanship idk I just recall someone being satly about rethinkdb
21:32 Craftsmanship genio, according to the logomatic
21:33 arcanez yes
21:42 Peppard joined #mojo
22:41 petru joined #mojo
23:14 stryx` joined #mojo
23:36 Ptolemarch joined #mojo

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