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

IRC log for #mojo, 2016-11-24

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

All times shown according to UTC.

Time Nick Message
00:02 marty joined #mojo
00:22 marty joined #mojo
00:22 polettix joined #mojo
00:28 jontaylor joined #mojo
00:52 cpan_mojo Mojo-RabbitMQ-Client-0.0.6 by SEBAPOD https://metacpan.org/release/SEBAPOD/Mojo-RabbitMQ-Client-0.0.6
01:33 aborazmeh joined #mojo
01:59 trwww joined #mojo
02:12 Paddi joined #mojo
03:26 aborazmeh joined #mojo
03:29 dmanto jberger I was able to find what the problem is, it is related to partial download
03:30 noganex_ joined #mojo
03:30 dmanto added an issue at Mojolicious::Plugin::AssetPack with a small lite app and instructions on how to reproduce the problem
03:31 dmanto sorry I didn't mean to find the problem, but how to repeat it :)
03:31 Paddi is that possible to have separate authentication (I'm using Mojolicious::Plugin::Authentication) within a single mojo::lite app? E.g., domain.com/A/dashboard ... domain.com/N/dashboard, all of them have similar template only different is display different set of data based on the placeholder, and user can concurrently login to multiple "placeholder
03:31 Paddi " at the same time?
03:32 Paddi currently my problem is user A enter domain.com/A/dashboard, and then domain.com/B/dashboard, switch back to A and browse something else, session expired, switch to B ... session expired too
03:33 Paddi tried assign cookie_name according to Path ...tried assin moniker according the Path/placeholder ... does not work :(
04:01 disputin joined #mojo
04:05 jberger Paddi I always roll my own Auth, it isn't too hard.
04:05 jberger The author of that plugin doesn't hang out on irc that I'm aware of, though I think he uses the mailing list
04:11 Paddi jberger: I see, thanks for the info. let me go through the mailing list first see if can find any clue
04:25 stryx` joined #mojo
05:04 dboehmer_ joined #mojo
06:37 Vandal15263 joined #mojo
06:57 dod joined #mojo
07:01 Paddi joined #mojo
07:03 dod joined #mojo
07:07 inokenty-w joined #mojo
07:45 damaya joined #mojo
07:46 damaya with Mojo::JSON is there any way to disable escaping of forward slashes?
07:46 damaya I understand the necessity for it when used in <script> tags, but I am not using this in any html.
07:49 Paddi I have similar problem few days ago, I use JSON::Parse; something like: my $newjson = parse_json ($original_json); then $newjson won't have escaped character
07:49 Paddi other guru here does not recommend JSON::Parse, in the meantime I still looking for other solution... please share if you manage to solve it, thanks
07:50 Jonis is nested delays an issue? using $c->delay in controller, then $c->delay in a helper function
07:50 Jonis or does it Just Work?
07:53 Snelius joined #mojo
08:05 polettix joined #mojo
08:10 rshadow joined #mojo
08:10 damaya Paddi: Thank you!
08:11 AndrewIsh joined #mojo
08:19 dod joined #mojo
08:24 stephan48 Jonis: i tested it in a minion task, it works quite good
08:24 trone joined #mojo
08:25 Jonis stephan48: thanks, trying to understand why it feels like I get a slower response when doing that, guess I'll have to actually do some proper benchmarking. My guess is there's something I'm doing wrong ;)
09:15 osfabibisi joined #mojo
09:26 parv joined #mojo
09:31 parv joined #mojo
09:54 cpan_mojo Mojolicious-Plugin-AssetPack-1.28 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.28
10:00 jontaylor joined #mojo
10:01 gbhat joined #mojo
10:04 bpmedley joined #mojo
10:26 polettix joined #mojo
10:55 parv joined #mojo
10:56 parv joined #mojo
11:18 mtj joined #mojo
11:19 jontaylor joined #mojo
11:19 gbhat joined #mojo
11:45 stryx` joined #mojo
11:47 mib_ja13q2 joined #mojo
11:48 mib_ja13q2 $ua->post( '127.0.0.1/api/action?some=arg' => form => { file => { content => $body, 'Content-Type' => 'application/octet-stream' } } )
11:49 mib_ja13q2 the above works, but I am wondering how/if I can move { some => "arg" } outside of the url string somehow
11:49 mib_ja13q2 I can't seem to find a place that takes query params within the ->post() action...
11:54 Sebbe mib_ja13q2: Usually query parameters are given either GET-style (in the URL), or POST-style (in the request body), and not a mix of the two. Does adding "some => arg" to the form data work with the API in question?
11:55 mib_ja13q2 doesn't seem like it, no
11:56 mib_ja13q2 the api is terribly documented, I fished out the above from stracing how the official client talks to it :/
12:04 bobkare you could build the url with Mojo::URL and it's ->query(...)
12:07 mib_ja13q2 yeah I suppose
12:15 mib_ja13q2 Sebbe: I am terrible at following go source code, but it seems that yes, they in fact specifically want the arguments to be get-style ( there are no tests for args in the apib though ): https://github.com/ipfs/http-api-spec/blob/master/apiary.apib#L922-L1048
12:19 mib_ja13q2 ah right: there it is documented in full, barf: https://github.com/ipfs/go-ipfs/blob/437cc7fa785256d24fe7591b17ad2146be992a24/docs/implement-api-bindings.md#implementing-bindings-for-the-http-api
12:43 sugar joined #mojo
12:45 Sebbe mib_ja13q2: Yeah, you'll have to construct the URL separately from the post then, I'm pretty sure. It's a pretty unconventional way of doing things.
12:58 janl joined #mojo
13:02 dantti_laptop joined #mojo
13:12 rshadow joined #mojo
13:19 jberger fyi (even though mib left), using POST you can't pass query parameters to the form argument, the form content generator only takes a single hashref
13:20 jberger when the method is GET or HEAD the form generator makes query parameters, otherwise body parameters
13:20 jberger as bobkare suggested, I'd reach for Mojo::URL at that point
13:45 dmanto joined #mojo
13:50 mishanti1 There is no reason that delays shouldn't work in a after_dispatch hook right? Trying to get something non-blocking here. Judging from my warn()DrivenDebugging the second step in my delay ( $c->delay(sub{...},sub{...}); ) never get executed.
13:54 mishanti1 PEBKAC. I'll show myself out.
14:13 rshadow joined #mojo
14:15 ramortegui joined #mojo
14:23 rshadow joined #mojo
14:35 recrof joined #mojo
14:42 recrof hi guys.. I have following code: http://pastebin.com/3QgDCtXV .. the problem is, that main#get_permissions gets executed AFTER match_perm(), what can I do about it? thanks!
14:48 recrof get_permissions does whole autentification stuff, and match_perm is "firewall" that checks if permissions match, should end the route if it doesn't
14:49 recrof get_permissions also uses $c->stash to store permission information which is not set when match_perm() is being executed
14:50 pink_mist you usually use an under to check permissions
14:51 asarch joined #mojo
14:54 recrof the code I pasted is simplified, because I generate rules from configuration file, where permissions per route are also defined
14:55 recrof that's why I'm trying to use $r->over, but it seems it gets executed before under('/api')->to(..) is executed..
14:56 rshadow joined #mojo
15:06 mishanti1 Is there a risk that the transaction goes away (as if by magic) and will not be available in steps executed inside an after_dispatch-hook?
16:56 rshadow joined #mojo
17:02 kaare joined #mojo
17:05 gizmomathboy joined #mojo
17:06 jabberwok left #mojo
17:11 abra joined #mojo
17:16 tchaves joined #mojo
17:44 gregf_ joined #mojo
17:45 rshadow joined #mojo
18:06 dod joined #mojo
19:29 dod joined #mojo
19:30 jontaylor joined #mojo
19:40 PryMar56 joined #mojo
19:45 CandyAngel Any recommendations for rendering out graphs to be served by Mojolicious?
19:45 CandyAngel Er.. modules for doing so, I mean
19:46 rshadow joined #mojo
19:46 preaction like bar charts and line charts?
19:47 CandyAngel I think I need scatter graph in particular (rendering fourier transform things)
19:47 * coolo only knows GD::Graph
19:47 preaction Chart::Clicker is a thing as well
19:47 dod joined #mojo
19:51 CandyAngel At least at home I can use the latest Mojolicious and not 6.36 :P
19:54 janl joined #mojo
19:56 rshadow joined #mojo
19:59 sugar joined #mojo
20:28 rshadow joined #mojo
20:50 stryx` joined #mojo
21:02 dmanto joined #mojo
21:05 dmanto left #mojo
21:15 stryx` joined #mojo
21:56 rshadow joined #mojo
22:55 mishanti1 I'm trying to make an after_dispatch-hook non-blocking, but I'm struggling a bit achieving consistent runs in my tests. I'm wondering if I need to do anything in the test-code to make it wait for the after_dispatch-hook to complete. Does any of you know it that is needed?
22:56 mishanti1 Specifically what I am testing is that a side-effect of some code executed non-blocking inside the hook is indeed realized.
22:57 mishanti1 If I simply loop my test-script then sometimes all the tests pass, and sometimes they crash, seemingly because the $tx as seen from inside the hook has disappeared.
23:09 sugar joined #mojo
23:14 mishanti1 Right. If I do the nasty (`sleep 1;`) in my test-script then it _always_ succeeds. I guess that means that control returns to my test-script while the after_dispatch-hook is still running.
23:44 jberger mishanti1 i can't follow what you are trying to do. Can you make a small demo app?
23:54 jabberwok joined #mojo
23:58 mishanti1 jberger: Yeah, on a second reading I see that it was a bad explaination. What I'm doing is inserting a row in a database in an after_dispatch-hook. In my test-file I am checking that the row is indeed in the database.
23:59 mishanti1 I'f I wait (by eg. sleeping) in the test file then the test always succeeds, but if I don't then it randomly succeeds.

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