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

IRC log for #mojo, 2018-01-31

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

All times shown according to UTC.

Time Nick Message
00:04 sri right direction, now more polishing
00:08 Grinnz run the pod through https://metacpan.org/pod2html to make sure that diagram will show up as you want on metacpan
00:18 kiwiroy joined #mojo
00:46 kiwiroy joined #mojo
01:33 kiwiroy joined #mojo
01:43 kiwiroy joined #mojo
02:09 dikim joined #mojo
03:56 Leffe joined #mojo
04:35 Leffe joined #mojo
05:04 dboehmer_ joined #mojo
06:32 Leffe joined #mojo
06:41 jamesaxl joined #mojo
06:59 inokenty-w joined #mojo
07:12 McA joined #mojo
07:12 kiwiroy joined #mojo
07:15 Vandal joined #mojo
07:15 dod joined #mojo
08:07 marcus good morning #mojo
08:07 trone joined #mojo
08:10 dod joined #mojo
08:14 kiwiroy joined #mojo
08:16 karjala_ joined #mojo
08:29 kiwiroy joined #mojo
08:33 seba joined #mojo
08:39 AndrewIsh joined #mojo
08:44 robx joined #mojo
08:50 kiwiroy joined #mojo
08:54 tyldis Morning
08:58 bianca joined #mojo
09:04 karjala_ hi
09:07 Ricaz I have a small script that needs to generate its own (Mojo) cookie with the same secret as the server, without talking to the server first. Can I easily do this with just the Sessions or UserAgent components?
09:08 Edward joined #mojo
09:14 marcus Ricaz:  my $checksum = Mojo::Util::hmac_sha1_sum($value, $self->app->secrets->[0]);
09:14 marcus return $self->cookie($name, "$value--$checksum", $options);
09:14 marcus <- this is what the Mojolicious::Controller signed_cookie method does
09:14 Ricaz $self->cookie() ?
09:15 Ricaz I can't use Mojolicious::Sessions for this?
09:34 marcus Ricaz: mojolicious::Sessions depends on mojolicious::controller iirc
09:39 Ricaz So.. I need to JSON encode my hash, then Base64 encode it, then get a checksum from this and a secret, then combine them?
10:14 hacre3 joined #mojo
10:17 hacre3 Hi all, I want to use write_chunk to iteratively render/write results. However, I googled quite some time and I cannot figure out how to use write_chunk in a loop-like setting. e.g. I have 1mio rows in a file and I want to write 10000 rows in each chunk. How would I do this?
10:17 hacre3 (without serving the file as an asset)
10:27 hacre3 Ha, I think I found it. I'll use the drain example from the rendering doc
10:37 marcus Ricaz: yeah, or create your own mojolicious app/controller and use sessions from it.
10:37 Ricaz marcus, okay thanks
10:43 robx joined #mojo
11:04 tchaves joined #mojo
11:13 itaipu joined #mojo
11:23 jnbek joined #mojo
12:33 wouter joined #mojo
12:34 wouter does mojolicious have support for rendering YAML files rather than JSON ones?
12:34 * wouter tried changing the json key to yaml in the hash that I passed to the render sub, but that didn't work
12:34 wouter but maybe it would work with some extra stuff?
12:37 wouter actually, turns out that JSON is a strict subset of YAML, so meh :)
12:41 mib_6s60up joined #mojo
12:41 kubrat joined #mojo
12:44 kubrat hi. is there a way to set up a Mojo::UA in a way that it croaks on any response that is not a success?
12:44 kubrat on anything that is not a 2xx reply
12:49 mib_6s60up left #mojo
12:56 bianca joined #mojo
13:10 dod joined #mojo
13:11 kubrat also, any chance of adding a _pretty_ option to the JSON parser?
13:16 dod joined #mojo
13:20 tcohen joined #mojo
13:21 CandyAngel It seems Morbo doesn't work on Win32 because it doesn't actually kill the worker.. it detects the file change fine
13:27 itaipu joined #mojo
13:32 mib_c8yhq3 joined #mojo
13:33 mib_c8yhq3 Good morning!
13:33 mib_c8yhq3 A test that checks numeric error codes retrieved from my DB has begun failing after updating to Mojo 7.61. It passes on 7.29.
13:34 mib_c8yhq3 The numeric values in the DB have leading zeroes which are stripped by the time Mojo::Test is examining them.
13:34 mib_c8yhq3 Was there a change that might explain this behaviour?
13:35 mib_c8yhq3 The DB column type is '`number` tinyint(2) unsigned zerofill NOT NULL,'
13:37 tinita kubrat: how can a parser parse pretty? ;-)
13:41 mib_c8yhq3 I take it that 7.61 dropped prior support for this MySQL-specific SQL "feature" ?
13:44 hahainternet CandyAngel: do you have a moment?
13:50 CandyAngel hahainternet: I'm at work so my responses may be sporadic, but sure
14:14 gizmomathboy joined #mojo
14:17 Pyritic joined #mojo
14:31 kubrat tinita: you know what I mean. have something like $res->json->pretty
14:31 kubrat :)
14:34 kubrat actually, yeah body->pretty, idk
14:37 haarg Grinnz: https://metacpan.org/pod/Mojo::JSON::MaybeXS#Upgraded-Numbers this section is inaccurate
14:41 dod joined #mojo
14:43 dod joined #mojo
14:43 dod joined #mojo
14:44 dod joined #mojo
14:50 dod joined #mojo
14:51 dod joined #mojo
15:00 jabberwok joined #mojo
15:07 gryphon joined #mojo
15:30 itaipu joined #mojo
15:37 ChmEarl joined #mojo
15:48 exp-innit sri: updated the issue I filed yesterday with a much clearer explanation and implemented the fix: https://github.com/kraih/mojo/pull/1186
15:49 exp-innit please lmk if anything is not acceptable
15:58 sri exp-innit: ignoring the rfc compliance question, it doesn't look like you used perltidy or followed deprecation rules
15:58 sri we can't just remove an attribute
15:59 sri you need a deprecation path
15:59 exp-innit sri: roger, i'll tidy them up, and this doesn't rely on the removal of the attribute, but it's unclear what the deprecation path would be as it's not any standard
16:00 sri there is cpan modules depending on ->origin
16:00 sri https://st.aticpan.org/source/EJUNGLE/Mojo-UserAgent-CookieJar-Role-Persistent-0.002/lib/Mojo/UserAgent/CookieJar/Role/Persistent.pm
16:00 exp-innit sri: sure, I'm not arguing it should be removed or anything
16:00 sri there is no point arguing with me, we have defined rules for this that need to be followed
16:00 exp-innit just not sure what path should be taken
16:01 sri well, that was your proposal
16:01 exp-innit how would you prefer i continue? the attribute can be left and the original behaviour left, but the host_only flag and setting the domain upon cookie collection would work fine IMHO
16:02 sri ok, i'll give it a work in progress label and leave it alone
16:02 exp-innit unfortunately that role doesn't seem to contain any tests
16:02 sri i have no idea how to continue, it's messy
16:03 exp-innit yeah I'm sorry I didn't notice the perltidy requirements, I didn't mean to imply that I wanted that attribute gone right there and then, just that that was the full 'solution'
16:04 exp-innit I'll read through this role and check how it uses it, and propose another series that is tidied and keeps origin but fixes this behaviour
16:07 sri only ways to make radical changes without deprecation path are a) security issue, and b) major release (8.0)
16:09 exp-innit yeah no argument here, my first attempt at a patch to mojo :)
16:13 sri a lot of arguments have been deprecated previously, if you want to see how to do it
16:13 sri umm
16:13 sri s/arguments/attributes/
16:22 disputin joined #mojo
16:32 Grinnz haarg: in what way?
16:33 haarg JSON::PP's behavior matches Mojo::JSON and Cpanel::JSON::XS
16:34 exp-innit looking at my patch a bit further, I think i added an unrequired test in there, and didn't nail down all uses of ->origin, so a bad PR regardless :)
16:34 haarg JSON::XS always encodes as a string if it has been used as a string.  "its last usage" isn't quite right.
16:35 Grinnz true. will fix
16:37 sri exp-innit: also squash your commits and force push, we don't care about the commit history
16:39 exp-innit sri: roger
16:40 exp-innit sri: did you use anything special to find the use of ->origin in that role?
16:40 sri nope, i just knew it existed
16:41 sri that's the biggest problem, you have no idea who might use ublic api how
16:41 exp-innit indeed, luckily this fix can just be slotted in there i believe
16:41 sri so, you have to figure out some way to break as little code as possible with a deprecation, always a problem
16:41 exp-innit understood, I believe I have an updated patchset which will do that, but I'm going to be a bit careful
16:43 exp-innit i've got a few other bits to do before I leave work today, so I'll submit this tomorrow, I want to nail down the behaviour of a line of code I'm unsure about
16:43 exp-innit sorry for any confusion above, thanks for the advice sri
16:47 sri exp-innit: no problem, hope you find a good solution
16:49 sri btw. our cookie jar code started before RFC 6265 existed
16:49 exp-innit yeah I found the original commits in 2013 adding this support
16:50 exp-innit the line i was confused with was https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/CookieJar.pm#L75 but I now understand why it only tests the domain part exists
16:50 exp-innit as that is to avoid the test of the origin, my replacement passes the same tests and seems to work correctly
16:50 exp-innit but I'll give it a check over tomorrow before pushing
16:51 sri think i never actually read the storage section https://tools.ietf.org/html/rfc6265#section-5.3
16:52 sri kinda weird it's part of the spec now
16:53 CandyAngel I just got tasked with writing out how everything is supposed to work at my workplace..
17:05 jabberwok CandyAngel: Everything? Even the coffee protocols?
17:05 CandyAngel if I do a good job, that might be added :P
17:05 sri that's the most important part
17:06 sh14 joined #mojo
17:06 CandyAngel I tried to install Statocles for it.. that didn't work at all
17:07 CandyAngel I just want Linux at work.. would make it so much easier to do stuff -.-
17:14 good_news_everyon joined #mojo
17:14 good_news_everyon [minion] atoomic opened pull request #64: Do not create an extra Mojo::Pg object (master...pg-new) https://git.io/vN5ZM
17:14 good_news_everyon left #mojo
17:14 exp-innit grep::cpan a useful tool
17:15 exp-innit shame the 2nd page of results never works :)
17:28 Seth joined #mojo
17:37 Grinnz haarg: https://github.com/Grinnz/Mojo-JSON-MaybeXS/commit/09156afe3b2bf94837cbf1e863c90ce30be0dda8 better?
17:41 haarg seems reasonable
17:45 bianca joined #mojo
18:00 dod joined #mojo
18:13 trone joined #mojo
18:54 dod joined #mojo
19:08 disputin joined #mojo
19:12 seba joined #mojo
19:28 marty_ joined #mojo
19:31 marty joined #mojo
20:11 jacoby joined #mojo
20:26 good_news_everyon joined #mojo
20:26 good_news_everyon [minion] kraih closed pull request #64: Do not create an extra Mojo::Pg object (master...pg-new) https://git.io/vN5ZM
20:26 good_news_everyon left #mojo
21:06 jacoby joined #mojo
21:18 polettix joined #mojo
21:22 polettix good whatever depending on your time zone
21:23 polettix Grinnz: thanks for the hint about metacpan/pod2html, it seems that the diagram is rendering fine
21:24 preaction joined #mojo
21:25 marcus So, any of you coming to fosdem? :)
21:27 tyldis Wonder how the atmosphere will be in the Perl devroom...
21:29 marcus Liz and Wendy are on a cruise this year.
21:31 tyldis I was planning to go, but $ork got too busy.
21:58 eseyman joined #mojo
21:59 polettix sri: I did some polishing of https://github.com/polettix/mojo/blob/patch/doc-reverse-proxy/lib/Mojolicious/Guides/Cookbook.pod
22:00 polettix should I propose a PR to get a conversation started in GitHub or is it better to discuss it here first?
22:00 polettix polishing -> proposal for a “Reverse Proxy” section
22:15 jacoby joined #mojo
22:20 reetspetit joined #mojo
22:22 reetp joined #mojo
22:23 disputin joined #mojo
23:01 hesco1 is there a convenient way to dump all of the data submitted in a PUT request so I can see its structure?
23:08 epiphero More on promises: shouldn't resolve and reject test their arguments and if "thenable", adopt the state of the argument?
23:08 hesco1 and as to another annoying question, on this page:
23:08 hesco1 http://search.cpan.org/~sri/Mojolicious-7.61/lib/Mojo/UserAgent.pm#build_tx
23:08 hesco1 what does the json mean in this example?
23:08 hesco1 my $tx = $ua->build_tx(
23:08 sri hesco1: follow the links
23:08 hesco1 PUT => 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'});y
23:09 sri also, search.cpan.org link... ewww
23:10 hesco1 so my hash gets json-ified before being PUT to my endpoint?  that is what I was hoping.  But $self->param() cannot seem to find my key.  very confusing.
23:13 nicomen hesco1: try $c->req->json perhaps?
23:13 nicomen (I might be totally wrong here, don't remember)
23:14 Grinnz yes, ->param only accesses query or body parameters in form-www-urlencoded format
23:14 Grinnz for json you need to ask for the decoded json
23:21 hesco1 thanks Grinnz and nicomen, trying that now.
23:22 hesco1 yes, thanks folks.  found my request data!  moving forward again!
23:23 epiphero For instance this (https://pastebin.com/scPvjHhi) prints 'a is resolved with Mojo::Promise=HASH(0x7fd4aa804200)'
23:23 Repaster Repasted text from epiphero: https://perl.bot/p/h3omly
23:23 epiphero while the equivalent JavaScript (modulo constructor differences) https://repl.it/repls/SugaryCurlyIndianskimmer produces 'a is resolved with b'
23:25 epiphero From what I can tell the resolve / reject methods don't follow https://promisesaplus.com/#point-49 (2.3.2)
23:28 sri epiphero: you might be correct
23:29 epiphero I'm looking at _settle to see how a fix would look
23:31 sri i know how
23:34 epiphero awesome ... should I open an issue to document?
23:39 dikim joined #mojo
23:56 good_news_everyon joined #mojo
23:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vNdT5
23:56 good_news_everyon mojo/master 53615cb Sebastian Riedel: promises can be settled with another promise
23:56 good_news_everyon left #mojo
23:56 sri epiphero: should be fixed

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