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

IRC log for #mojo, 2017-03-08

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

All times shown according to UTC.

Time Nick Message
00:06 marty_ joined #mojo
00:19 miller joined #mojo
00:23 marty joined #mojo
00:23 marty joined #mojo
00:24 marty joined #mojo
00:31 marty joined #mojo
00:32 marty joined #mojo
00:48 aborazmeh joined #mojo
01:22 Sebbe joined #mojo
01:36 stryx` joined #mojo
01:58 Sebbe joined #mojo
02:46 genio sri: Would I be able to talk you into a convenience Mojo::URL  canonical method that would pretty much just do  ->path->canonical ?  HTTP::Request relies on URI's ->canonical and it would be nice to be able to use Mojo::URL objects as well
02:50 genio err, path->canonicalize
03:12 noganex_ joined #mojo
03:31 jberger genio: I'm guessing that's unlikely
03:32 jberger *Mojo::URL::canonical = sub { shift->path->canonicalize } should do it for you though
03:54 genio oh well. worst case is instead of passing the Mojo::URL object I'd have to pass the $url->to_string() to the HTTP::Request
03:59 jberger or easier, "$url"
05:04 dboehmer joined #mojo
06:51 dod joined #mojo
07:02 stryx` joined #mojo
07:50 stryx` joined #mojo
07:53 AndrewIsh joined #mojo
08:03 tempire joined #mojo
08:40 trone joined #mojo
08:55 janl joined #mojo
09:04 sh14 joined #mojo
09:06 sugar_ joined #mojo
09:10 sri genio: no, since canonicalizing a URL is something else
09:53 prg joined #mojo
10:24 prg sri, jberger: fyi, the problem i described yesterday persists after upgrading Mojo::Pg to 3.04; i guess jberger has to update Minion::Notifier to use ->reset?
10:25 stryx` joined #mojo
10:26 prg another thing i just noticed (and can't make sense of): having two tabs of my app open in parallel, only one of them gets the notifications from the websocket
10:31 sri yes, without jberger releasing an update it won't do anything
10:43 jkramer_ left #mojo
10:44 irqq joined #mojo
10:50 foursixnine So, while trying to add some kind of progress notification on transactions (i.e, trying to download a big file), i seem unable to do it on the Mojo::UserAgent. I would expect something like $tx->on(progress => sub { say "hi" }) to work for all the subsequent calls when i do $ua->start($tx)
10:50 foursixnine but i see no "Hi" :(... mojo doesn't like me this way...
10:50 sugar_ joined #mojo
10:50 foursixnine i found this gist to work: https://gist.github.com/olegwtf/c9c5a266352cba73dc5b
10:52 foursixnine But i would like to understand the reason... Or if it's just like that
11:01 salva joined #mojo
11:02 salva joined #mojo
11:12 sri foursixnine: the $tx->req->once(finish => sub {... shouldn't be necessary
11:13 sri $tx just doesn't have a progress event http://mojolicious.org/perldoc/Mojo/Transaction/HTTP#EVENTS
11:13 sri http://mojolicious.org/perldoc/Mojo/Transaction#EVENTS
11:14 sri res/req are Mojo::Message subclasses that do have a progress event http://mojolicious.org/perldoc/Mojo/Message#EVENTS
11:16 sri btw. you can see the class hierarchy here http://mojolicious.org/perldoc#REFERENCE
11:24 rshadow joined #mojo
11:58 marty_ joined #mojo
12:05 dotan_convos joined #mojo
12:05 aborazmeh joined #mojo
12:21 gregf_ joined #mojo
12:40 jkramer_ joined #mojo
12:40 jkramer_ Ahoy!
12:41 jkramer_ I just noticed that Mojo::DOM->text doesn't return anything when the node is a text node. I guess it's a bug?
12:41 jkramer_ ->content works though, I was just thinking that ->text should too.
12:42 pink_mist jkramer_: ->text is documented to work on elements, not nodes
12:42 jkramer_ Well, yes, though it'd make sense if ->text returned the text of a text node anyway. :)
12:43 janl wrong kind of sense
12:43 sri didn't you open a github issue for that before?
12:44 sri ah, not you
12:44 sri https://github.com/kraih/mojo/issues/1022
12:44 sri died of lack of interest, so no, we won't do it
12:52 foursixnine sri, thanks! that helps a lot :)
12:56 pilot joined #mojo
13:26 hummeleBop joined #mojo
13:29 jkramer_ left #mojo
13:35 hummeleBop joined #mojo
13:39 hummeleBop joined #mojo
13:48 hummeleBop joined #mojo
14:08 bwf joined #mojo
14:12 marty joined #mojo
14:13 sri foursixnine: if you feel like contributing, i suppose the cookbook example could use a second example with some progress infomration http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Large-file-downloads
14:14 Pyritic joined #mojo
14:16 marty joined #mojo
14:17 asarch joined #mojo
14:20 gryphon joined #mojo
14:23 preaction joined #mojo
14:38 dotan_convos joined #mojo
14:40 dotan_convos joined #mojo
14:52 dotan_convos joined #mojo
15:00 gizmomathboy joined #mojo
15:07 stryx` joined #mojo
15:10 Pyritic joined #mojo
15:18 VVelox joined #mojo
15:20 mcsnolte joined #mojo
15:25 Pyritic joined #mojo
15:41 stryx` joined #mojo
16:05 zivester joined #mojo
16:33 lluad joined #mojo
16:45 itaipu joined #mojo
16:48 * sri ran into an interesting problem with postgres upserts today
16:50 sri i have a table with a serial id, a text email address, and an int count for how many times that address has been found
16:50 sri oh, and an int field referencing another table
16:51 sri so i want reference + email to be unique
16:51 sri but, email can be larger than 8191 bytes
16:52 sri so i can't just create a unique constraint on the two fields
16:53 sri now, what i ended up with is a unique index on the reference and the md5 sum of the email address :)
16:54 sri create unique index on some_table (package, md5(email));
16:54 sri and ... on conflict (package, md5(email)) do ...
16:55 sri for the upsert
16:55 sri figured i'd mention it since it took me quite some time to find :)
16:56 stryx` joined #mojo
16:56 sri so yea, upserts with columns that are bigger than 8191 bytes are tricky
17:02 Grinnz unique indexes on data that large is tricky to begin with :P
17:02 Grinnz personally i would just say "don't put email addresses that large in my website"
17:05 jberger didn't realize that you there is a cap on unique index
17:06 jberger especially strange since the text field doesn't have a cap by default
17:08 coolo sri: and ignoring email addresses > 2K wasn't an option? :)
17:09 sri coolo: they are already in the database ;p
17:09 marty_ joined #mojo
17:09 Grinnz tell them they're voted off the island
17:09 jberger anyway, that's an interesting solution
17:10 * coolo introduces sri to DELETE :)
17:11 Grinnz slightly relevant https://xkcd.com/1808/
17:22 itaipu joined #mojo
17:22 prg quick poll: module recommendations for sending mail via external server
17:23 pink_mist prg: /msg perlbot sending email
17:23 Grinnz Email::Sender::Simple, using Email::Sender::Transport::SMTP
17:23 pink_mist prg: and perlbot will tell you the good stuff to use
17:24 pink_mist (it'd be easier if perlbot was in here)
17:24 lluad +1 on Email::Sender
17:24 Grinnz or configure your box's sendmail to use SMTP itself
17:24 Grinnz and then use the Email::Sender default transport
17:25 prg i'd rather not touch sendmail, but thanks for the suggestions. i'll look into those
17:25 lluad Yeah. If you need to handle network / smarthost outages having local spooling on your box that forwards to the real MTA is helpful.
17:25 Grinnz you can do that with things like ssmtp or postfix
17:25 lluad Yup.
17:26 Grinnz there's another common one that i'm forgetting
17:26 prg actually i wanted to use some sort of mail-as-a-service thing, but our customer insists on sending mails through his server
17:26 lluad ssmtp is simple to set up, and does pretty much what you need.
17:26 lluad Is the customer aware of email reputation, junk folders, deliverability and other such things?
17:27 Grinnz these services provide a sendmail binary for you which handles the sending according to your configuration
17:27 prg well, i am and told him
17:27 lluad If not, I'd plan on making it easy to switch out whatever you use for, e.g., a sendgrid shim for when they start crying. :)
17:27 Grinnz so your application doesn't have to worry about it
17:27 prg they're concerned about legal issues
17:28 lluad Oh. They'll have a moment of clarity eventually (and then we'll take their money :) ).
17:28 Grinnz hehe
17:28 prg lluad: you're working for sendgrid? :)
17:29 lluad No, wordtothewise.com. We're a (high end) email consulting company.
17:29 prg ah, ok
17:29 lluad We get a lot of customers who've made ... poor ... email architecture choices in the past. :)
17:29 prg i can imagine :D
17:38 prg still, i think i'll abuse Minion for "local spooling" and just hand the mails off to the external host
17:54 stryx` joined #mojo
18:00 jberger prg the fix that I rolled out to Minion::Notifier before didn't help you?
18:00 jberger I can (and will) push out another release with ->reset but I don't THINK too much is different between my hack of unsubscribing from a dummy channel and ->reset
18:02 dod joined #mojo
18:13 sugar_ joined #mojo
18:16 dod joined #mojo
18:26 prg joined #mojo
18:27 prg jberger: your latest Minion::Notifier release fixes the postgres connection issue, but i still had another problem
18:27 jberger ok so another release, with ->reset, would presumably only address that same connection issue
18:27 jberger what was the other problem?
18:28 prg which my homegrown solution also had, i fixed it by adding $c->on(finish => sub { $c->minion->backend->pg->pubsub->unlisten(foo => $cb); })
18:28 prg to my websocket endpoint, that is
18:28 prg otherwise i would get "connection already closed" errors (with Minion::Notifier), or just silent fails with my solution
18:30 prg i guess some listener isn't properly cleaned up?
18:54 stryx` joined #mojo
19:05 itaipu joined #mojo
19:09 prg` joined #mojo
19:16 howitdo joined #mojo
19:31 irqq joined #mojo
19:36 marty joined #mojo
19:38 marty joined #mojo
20:03 stryx` joined #mojo
20:07 schelcj joined #mojo
20:24 dantti_laptop joined #mojo
21:10 prg` joined #mojo
21:16 itaipu joined #mojo
21:23 Pyritic joined #mojo
21:51 PryMar56 joined #mojo
21:59 prg` joined #mojo
22:38 gryphon joined #mojo
22:45 gizmomathboy joined #mojo
22:58 Janos joined #mojo
23:07 * sri yawns
23:08 * sri got tons of mojolicious stickers delivered today and will be handing them out every chance he gets from now on
23:10 Grinnz stickers!
23:10 purl stickers are a bad idea. They scrape them off to see if they're covering up stamps or other notes.
23:10 Grinnz ...right
23:11 sri liz and wendy got 1000 too, so most perl conferences should have them available from now on :)

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