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

IRC log for #mojo, 2017-05-23

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

All times shown according to UTC.

Time Nick Message
00:07 tarski joined #mojo
00:23 punter joined #mojo
00:28 dabudabu \o/
00:51 bwf joined #mojo
01:13 aborazmeh joined #mojo
02:04 noganex joined #mojo
02:29 aborazmeh joined #mojo
02:57 skycarl joined #mojo
04:00 stefan_ sri: thanks for the reassurance!  When I see simple commits with simply weaken()s it appears as tho it comes so simply!  I'm glad to know that that's not always the case!  :)
04:04 dboehmer joined #mojo
04:49 punter joined #mojo
04:59 punter joined #mojo
05:09 tyldis Grinnz: A lot of media hype about BTC these days. Ethereum also soared.
05:35 veryrusty joined #mojo
05:40 zen tyldis: yes :D
05:44 zen russia is also looking into legalising btc
05:44 purl okay, zen.
05:44 marcus good morning #mojo
05:44 zen good morning
05:44 purl For you maybe.
05:52 dod joined #mojo
05:58 dod joined #mojo
06:37 Vandal joined #mojo
06:45 veryrusty joined #mojo
06:45 Peppard joined #mojo
06:52 AndrewIsh joined #mojo
07:22 trone joined #mojo
07:23 inokenty-w joined #mojo
07:27 prg joined #mojo
07:30 Petru joined #mojo
07:32 Petru I’m trying to test the functionalities available only for logged in users. I’ve tried doing $t->session(logged_in => 1); but I get Can't locate object method "session" via package "Test::Mojo::Session" . $t gets constructed like this: my $t = Test::Mojo::Session->new('WebApp');  how can I fix the problem or what are the best ways for testing what I want?
08:06 skycarl joined #mojo
08:14 aborazmeh joined #mojo
08:25 rshadow joined #mojo
09:26 irqq joined #mojo
10:09 kamyl I'm using Mojo::IOLoop->recurring in a websocket method (writing message over websocket every 5 sec when the connection is open), it fails when the client's browser gets closed. I'm getting an error from mojo which obviously states that perl couldn't write anything to the socket since it's closed. May I ask for a suggestion of a check to see if the websocket is still available? I tried some of the methods from
10:09 kamyl Mojo::IOLoop, Mojo::Transaction::Websocket and Mojo::Transaction but couldn't figure which method can tell me if the socket is available to write
10:17 asymp joined #mojo
10:23 prg kamyl: what about "established" in Mojo::Transaction::WebSocket?
10:24 batman kamyl: do you store the $id returned from recurring() ? you should store that and remove the recurring timer on finish
10:24 prg that's probably even better
10:25 batman kamyl: https://github.com/Nordaaker/convos/blob/da9650fa79d65cb118df3055e7af59ea02cc9b5b/lib/Convos/Controller/Events.pm#L56 <-- look for `$tid`
10:28 prg so i have a named route in the form of "/foo/:id", url_for("my_name", id => 1) works as expected returning "/foo/1". when i change that route definition to "/foo/:id*bar", url_for only gives me "/foo/". what's up with that?
10:29 prg url_for("my_name", id => 1, bar => "whatever") doesn't work either...
10:29 kamyl batman: storing $id - good hint, I don't do that right now. I'm wrapping my head around the code you posted, it looks like it will solve my problem, thank you
10:30 batman there's a bunch of code there that you don't need... just look for where $tid is used
10:30 kamyl batman: that's exactly what I'm focusing on :)
10:31 batman :)
10:31 prg nvm, "/foo/:id(*bar)" seems to work
10:42 tchaves joined #mojo
10:43 noganex_ joined #mojo
10:57 stryx` joined #mojo
11:10 stryx` joined #mojo
11:50 veryrusty joined #mojo
12:08 stryx` joined #mojo
12:22 jberger joined #mojo
13:09 rshadow joined #mojo
13:20 rshadow joined #mojo
13:21 stryx` joined #mojo
13:23 gizmomathboy joined #mojo
13:32 gryphon joined #mojo
13:34 maschine joined #mojo
13:50 aborazmeh joined #mojo
14:00 disputin joined #mojo
14:07 stryx` joined #mojo
14:32 rshadow joined #mojo
14:57 disputin joined #mojo
15:17 stryx` joined #mojo
15:24 rshadow joined #mojo
15:39 stryx` joined #mojo
15:42 sh14 joined #mojo
15:55 stryx` joined #mojo
16:21 punter joined #mojo
16:35 stryx` joined #mojo
16:36 hkclark joined #mojo
16:42 hkclark Hi all, I have a minion app and I keep getting errors like: "Worker error: Active version 15 is greater than the latest version 13 at"
16:42 hkclark I'm not doing any schema updates myself
16:42 hkclark is there some recommended way to prevent these?
16:43 hkclark I have looked through the docs and see auto_migrate but I'm unsure what the recommended way to handle these is
16:43 hkclark since if I fix it they seem to magically reappear
16:43 hkclark and I have been fixing it by just deleting and recreating the minion db
16:44 sri you updated one machine but not all
16:44 PryMar56 joined #mojo
16:44 sri that doesn't work, all minion boxes need the same version of minion
16:45 sri that error message protects you from corrupting the database
16:45 hkclark oh ok, so my "frontend" webapp that drops jobs in the queue has a newer version of minion/mojo than my backend job queue does - is that the idea?
16:46 sri yes
16:46 hkclark ok, makes sense.  Thank you very much
16:46 hkclark I'll watch that more carefully
16:47 sri i guess those errors could mention that they are from database migrations
16:48 sri but that's a Mojo::Pg feature
16:48 litwol Hello
16:48 litwol Does perl/mojo have webpack equivalent?
16:49 jberger litwol: Mojolicious::Plugin::AssetPack
16:49 purl well, Mojolicious::Plugin::AssetPack is up to date. (0.31)
16:49 litwol or, is it common/expected to mix perl + nodejs technologies?
16:49 * litwol reads
16:50 jberger purl, no Mojolicious::Plugin::AssetPack is like assetpack for Mojolicious
16:50 purl OK, jberger.
16:50 jberger err
16:50 jberger purl, no Mojolicious::Plugin::AssetPack is like webpack for Mojolicious
16:50 purl ...but no mojolicious::plugin::assetpack is like assetpack for Mojolicious...
16:50 jberger gah
16:52 jberger ok all better now
16:53 dod joined #mojo
17:00 hkclark @sri That works fine and makes sense (the migration thing). Thank you.
17:04 trone joined #mojo
17:05 hkclark sri: Sorry, meant sri: above - too much Slack lately and my fingers auto-type @ vs : now :-)
17:06 sri both works with my irccloud :)
17:06 hkclark ok :-)
17:09 disputin joined #mojo
17:10 disputin joined #mojo
17:15 * genio glares darts at Slack anyway :) (we use it at work now)
17:23 maschine is there a good example for the application of migrations?  does Convos use it?
17:24 sri https://github.com/kraih/mojo-pg/tree/master/examples/blog
17:27 sri another app from work that only has one migration https://github.com/openSUSE/build-check-statistics/blob/master/lib/SUSE/BuildCheckStatistics/resources/migrations/build_check_statistics.sql
17:27 sri the minion migrations https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L783
17:28 litwol Reading documentation. on this page https://metacpan.org/pod/distribution/Mojolicious-Plugin-AssetPack/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod#Current-Mojolicious-application
17:28 litwol cookbook link goes to 404 https://metacpan.org/pod/Mojolicious::Plugin::Assets::Guides::Cookbook#DYNAMIC-ASSETS
17:32 maschine thanks!  I've been studying your blog example for my switch to Postgres, I missed that bit about migrations in there.  It seems pretty straightforward, and solve some questions I had about adding tables, etc.
17:32 punter joined #mojo
17:38 punter Which should be prefered? Plenv or Perlbrew?
17:41 jberger I like perlbrew because plenv uses some weird shims
17:42 jberger but for deployment, probably best to just compile to a directory using perl-build
17:42 jberger https://metacpan.org/pod/distribution/Perl-Build/script/perl-build
17:42 punter thanks
17:44 punter I don't like it very much that plenv installs necessarilly in a user's homedir (for production i'd rather have a separate directory with perl binary)
17:45 litwol Question about assets without topics. https://metacpan.org/pod/distribution/Mojolicious-Plugin-AssetPack/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod#Assets-without-topics
17:46 disputin joined #mojo
17:46 litwol gif example shows conversion into <img> tag. which is great. the question: What additional attributes can i output into <img> tag?
17:46 litwol for eample, height/width. is it possible? how ?
17:58 Grinnz 13:41:33 <jberger> I like perlbrew because plenv uses some weird shims
17:58 Grinnz i like plenv for the opposite reason, perlbrew uses perl weirdly :P
17:58 jberger fair
17:59 jabberwok litwol: you'd probably want to use Imager; to retrieve the dimensions of an image
17:59 Grinnz punter: you can install any perl to that directory with perl-build yourself, plenv just provides an install command for convenience... or if you're just deploying one perl then build it and use it, no need for switching
18:00 jberger litwol MDN is a great resource for stuff like that
18:00 jberger https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
18:03 Pyritic joined #mojo
18:16 dod joined #mojo
18:27 litwol jberger: i meant, using asset() helper. can i coax it into outputting different style tag markup depending on my needs ?
18:28 jberger I don't know what that means
18:30 chandwki I'm having a heck of a time trying to figure out how to handle authorization using Mojolicious::Plugin::OpenAPI
18:30 litwol example in above document shows asset '/img/asset.gif' => <img src=... >
18:31 chandwki it looks like it doesn't respect swagger security definitions in any way?
18:32 litwol that perl to html markup translation... do i have any control over it ? can i modify it and add new attributes ?
18:36 disputin joined #mojo
18:36 chandwki so, with the OpenAPI plugin I can define a custom route to handle authentication... great but I obviously don't want to do authentication on my /api/login route
18:37 chandwki because that's how you get a token
18:37 chandwki it seems like the OpenAPI plugin is lacking
18:38 irqq joined #mojo
18:38 jberger batman: ^^
18:39 jberger chandwki actually maybe this should be moved to #swagger ?
18:39 chandwki well, it's mojolicious related... specifically to this plugin
18:40 chandwki I've googled the heck out of it, seems like not a lot of people are using swagger + mojolicious to make APIs though
18:46 jacobydave joined #mojo
19:06 asymp left #mojo
19:09 jberger chandwki it is mojolicious related yes, but there is enough traffic about swagger that the author of the mojolicious openapi plugin (and the swagger plugin before it) made another channel to not swamp this channel in the discussion
19:10 chandwki oh, it looks like that channel is perl specific, alright thanks
19:11 preaction this is the Perl IRC network
19:12 jabberwok was that a FCC_mandated Station Break?
19:15 jberger "Biff throws to 1st base for the second out of the inning, and now 10 seconds for station identification"
19:16 jabberwok (( CBS radio doo-da-dee-da-doo tone sounds faintly in the background ))
19:21 punter joined #mojo
19:29 disputin joined #mojo
19:46 sri omg, those new google emoji are unbelievably bad
19:48 sri https://pbs.twimg.com/media/DAek4aYXYAAOSVO.png
19:49 rshadow joined #mojo
19:49 sri https://pbs.twimg.com/media/DAeorBkWsAAy2pX.jpg
19:50 maschine joined #mojo
19:51 sri the worst use of gradients i've ever seen
19:55 chandwki alright so I got a catch all authorization controller calling the auth method, but if I try and return 401 it gets ignored and keeps going to the next controller method
19:56 chandwki I would love to see an example mojolicious API using JWT for authentication, I seem to be doing it wrong somehow
20:01 Grinnz heh those look pretty bad
20:01 Grinnz maybe they asked samsung for help
20:05 sri i don't even mind having the samsung emoji anymore... lol
20:34 asymp joined #mojo
20:35 Dandre left #mojo
21:18 castaway joined #mojo
21:21 zivester joined #mojo
21:36 kaare_ joined #mojo
21:51 disputin joined #mojo
21:52 disputin1 joined #mojo
21:54 rshadow joined #mojo
22:44 disputin joined #mojo
22:44 sri CHYC: afraid it doesn't look like there is much interest in validation output formatters
22:45 sri and while i would like the functionality, the implementation is too ugly to get my vote :(
22:45 trone joined #mojo
22:45 sri in case someone still wants to voice their opinion https://github.com/kraih/mojo/pull/1096
22:46 sri (for me personally output_formatters is a total deal breaker)
23:32 zivester joined #mojo
23:48 jnap chandwki: 'using JWT for authentication' seems to mean a lot of different things.  I found no obviously good way in Catalyst and ended up with a dreaded local hack.  But the Mojo stuff here seems more straightforward

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