<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:13 codestorm joined
00:16 Cohedrin joined
00:36 nighty-- joined
00:39 LastWhisper____ joined
00:39 gvaughn joined
00:40 gvaughn_ joined
00:52 watersoul joined
00:52 <iFire> fishcakez: can you point to a test that'll actually run on the database?
00:52 <iFire> as an example
00:53 chazlever joined
00:54 Notimik joined
00:55 x0nic joined
00:55 steffkes joined
00:55 riddle joined
00:56 nerdystreetrat joined
00:56 Isilkor joined
00:56 clarkkampfe joined
00:56 mjanssen joined
00:59 mlitwiniuk joined
01:01 sevenseacat joined
01:03 Ioyrie joined
01:07 codestorm joined
01:07 gvaughn_ joined
01:08 gvaughn__ joined
01:16 icapurro joined
01:20 Jam666 joined
01:20 Jam666 joined
01:25 <aeliton> hi All, I'm trying to use Regex to extract two information from a string (username and password) like this: Regex.named_captures(~r/username: *\"(?<user>[^\\]*)|password: *\"(?<pass>[^\\]*)\"/, "mutation {\n login(password: \"123456\", username: \"aeliton\"){\n token\n }\n}")
01:26 <aeliton> but the response is: %{"pass" => "123456\", username: \"aeliton", "user" => ""}
01:26 <aeliton> Can anybody point my mistake?
01:29 <iFire> aeliton: what is the source input?
01:30 <iFire> I think the sigils don't need too much escaping
01:31 <aeliton> iFire: "mutation {\n login(password: \"badcoffee\", username: \"jenifer\"){\n token\n }\n}"
01:31 <aeliton> it's a string
01:32 <iFire> aeliton: first of all I would clear all the white space things
01:32 <iFire> or just use a poison parse
01:32 <iFire> there has to be function there
01:33 <iFire> Poison.decode!(~s({"name": "Devin Torres", "age": 27}), as: %Person{})
01:33 <iFire> https://github.com/devinus/poison
01:34 <aeliton> that's GraphQL, does Poison deals with it?
01:35 <aeliton> I believe it works only with JSON
01:35 icapurro joined
01:36 <sevenseacat> parsing graphql input? I'd look at using an existing graphql library, or at least how they do it
01:37 <Radar> ^
01:39 tomterl joined
01:39 <aeliton> I'm guardian to ensure the graphql calls are correctly authenticated, but I need my login mutation not to be enforced to have a token. My plan is just to workaround this by inserting a new Plug that will identify username and password and embed a valid token (while a implement a cleaner solution to that)
01:40 <aeliton> *I'm using guardian
01:42 <aeliton> I'm already usin abisinthe-graphql library, but it wont let me have two redirects of Absinthe.Plug
01:43 <aeliton> if that were possible, I would have a scope not piped through the pipeline that contains plug Guardian.Plug.EnsureAuthenticated
01:44 jkreeftmeijer joined
01:46 kronicdeth joined
01:46 <aeliton> I want a regex like this: https://regex101.com/r/us1Pgb/1
01:47 <aeliton> that would allow me to get username and password in groups
01:47 baweaver left
01:49 chrismccord joined
01:58 sfbw joined
02:01 akeating joined
02:02 codestorm joined
02:12 nii236 joined
02:15 <benwilson512> aeliton: why are you trying to manually handle graphql query strings?
02:16 <benwilson512> aeliton: I would rework how you do stuff with guardian
02:16 <benwilson512> don't require a logged in user in order to do graphql
02:16 <benwilson512> instead use guardian to put the current user in the context
02:16 <benwilson512> and then authorize in the resolver
02:16 <benwilson512> then you can have a login mutation
02:17 nbg joined
02:39 nbg joined
02:41 wong2 joined
02:45 codestorm joined
02:48 nii236 joined
02:56 steffkes joined
02:57 meandi_2 joined
03:00 nii236 joined
03:14 nii236 joined
03:33 Guest55 joined
03:37 icapurro joined
03:46 jkreeftmeijer joined
03:54 smferris joined
04:21 smferris joined
04:23 Guest55 joined
04:24 sfbw joined
04:37 toastytheog joined
04:39 Dakora joined
04:39 davidw joined
04:41 <Dakora> hey, is there a special way to query bytea fields in ecto? i keep getting an `(ArgumentError) cannot perform Kryten.Repo.get/2 because the given value is nil` however i cannot find what value it is referring to. i inspected all of the values i'm using and they are not nil
04:42 <Dakora> i get this with both get_by and doing a manual query with where and Repo.one
04:43 <Dakora> whoops the stacktrace mislead me, it was actually a child query calling this error, nevermind :>
04:43 jeffweiss joined
04:44 nii236 joined
04:47 jkreeftmeijer joined
04:57 steffkes joined
04:58 icapurro joined
05:24 sfbw joined
05:34 teamj joined
05:54 refriedchicken joined
05:55 cemilowski joined
05:56 m_m joined
05:56 imack joined
06:04 gvaughn joined
06:06 josevalim joined
06:18 rschmukler joined
06:19 voltone joined
06:25 jkreeftmeijer joined
06:25 jkreeftmeijer joined
06:27 sfbw joined
06:27 robinsjdotcom joined
06:27 jkreeftm_ joined
06:29 craigp joined
06:32 wsieroci joined
06:35 MaSven joined
06:38 tuacker joined
06:45 harfangk joined
06:49 toastytheog joined
06:54 steffkes joined
06:55 asabil joined
06:55 jkreeftmeijer joined
06:57 jkreeftm_ joined
07:00 sfbw joined
07:03 gokr joined
07:03 mk[] joined
07:12 vmoravec joined
07:13 Liquid_X joined
07:17 PaReeOhNos joined
07:18 pcre joined
07:18 robinsjdotcom joined
07:22 milad joined
07:27 mk[] left
07:27 imack joined
07:29 <fishcakez> iFire: ./integration_test/
07:29 ZippoWeb joined
07:30 cemilowski joined
07:31 nd__ joined
07:36 asabil joined
07:41 inoas joined
07:42 mark_66 joined
07:42 dastagg joined
07:45 sn00ppy joined
07:46 milad joined
07:46 milad joined
07:47 robinsjdotcom joined
07:48 robinsjdotcom joined
07:48 sn00ppy left
07:48 marr joined
07:50 stephen_m joined
07:51 bigkevmcd joined
07:51 Guest67 joined
07:52 gvaughn joined
07:55 jimmyrcom joined
08:02 sfbw joined
08:03 craigp_ joined
08:06 jkreeftmeijer joined
08:07 rschmukler joined
08:09 Cohedrin joined
08:13 josevalim joined
08:15 robinsjdotcom joined
08:19 akeating joined
08:20 lexmag joined
08:21 hbraun joined
08:23 jkreeftm_ joined
08:28 proteusguy joined
08:37 icapurro joined
08:42 milad joined
08:42 milad joined
08:58 chrisml left
09:01 rschmukler joined
09:02 sfbw joined
09:03 craigp_ joined
09:07 akeating joined
09:08 akeating joined
09:14 craigp joined
09:14 Guest67 joined
09:26 <whodidthis> is there a way to limit string lengths from error outputs
09:27 <whodidthis> for example strings in structs or maps
09:40 codestorm joined
09:41 <OliverMT> benwilson512: a question for you.. hierarchical ACL using absitnthe/graphql.. whats the story there? do you do it in the resolver?
09:41 gvaughn joined
09:41 <OliverMT> we're starting to become frontend heavy, so pondering if we're getting to the point where graphql starts to make sense in terms of gains for effort
09:45 byte512 joined
09:53 odogono joined
09:53 gregman_ joined
09:56 sevenseacat joined
09:59 asabil joined
10:03 sfbw joined
10:07 lexmag joined
10:08 mhutter joined
10:08 mhutter joined
10:17 meh` joined
10:17 cemilowski joined
10:27 Gasher joined
10:36 gmcabrita joined
10:38 robinsjdotcom joined
10:46 akovari joined
10:49 rschmukler joined
10:51 cemilowski joined
10:51 craigp joined
10:57 dimitarvp joined
11:03 milad joined
11:03 milad joined
11:04 sfbw joined
11:12 MarioBranco joined
11:16 nighty-- joined
11:23 icapurro joined
11:24 cevado joined
11:28 MarioBranco joined
11:29 codestorm joined
11:29 gvaughn joined
11:36 bturnbull joined
11:37 <ivan> heh, erlexec is getting its exec-port binary into my escript even though it never looks for it there
11:38 mhutter joined
11:41 meh` joined
11:43 cristianR_ joined
11:47 sfbw joined
11:50 aeliton joined
11:53 proteusguy joined
11:54 codestorm joined
12:12 akeating joined
12:12 robinsjdotcom joined
12:22 akeating joined
12:22 segmond joined
12:25 codestorm joined
12:27 akeating joined
12:28 milad joined
12:33 seancribbs joined
12:37 rschmukler joined
12:42 bpmcd joined
12:42 whharris joined
12:44 bturnbull joined
12:49 asabil joined
12:52 sekjun9878 joined
12:53 <iFire> OliverMT: I was thinking of porting this langauge to elixir https://github.com/joyent/node-aperture
12:54 maxirater joined
12:54 <nox> iFire: That seems unmaintained.
12:54 <iFire> considering it's what joyent uses for everything I doubt it
12:56 <iFire> so I guess it's just complete :)
12:57 <iFire> evidence that it is used for their entire rbac https://docs.joyent.com/public-cloud/rbac
12:59 akeating joined
13:00 <benwilson512> OliverMT: yeah in general you handle that in the resolver. Absinthe 1.3 provides a number of handy ways for annotating your schema with sort of middleware code that can let you abstract authorization concerns from the main resolution code
13:01 <iFire> OliverMT: nox I don't have any bandwidth to work on it, but it seems like a good idea to take this working system and port it.
13:01 <OliverMT> in our case we short circuit the entire rest call if the parent id of the hierarchy you are trying to enter is not in your access list
13:01 ramortegui joined
13:02 <OliverMT> it seems a bit overengineered tbh
13:02 <OliverMT> since we're already in the code environment
13:02 <iFire> OliverMT: you're replying to benwilson512 right?
13:03 <OliverMT> err. first line was to benwilson512
13:03 <nox> iFire: That Joyent uses it just sounds like they NIH'd a rule system.
13:03 <OliverMT> second two was for you
13:03 <OliverMT> forgot to add nicks :D
13:03 gregman_ left
13:03 <iFire> nox: well considering they wrote [as in the legacy of sun microsystems had one in solaris] I don't mind..
13:04 kronicdeth joined
13:04 <nox> Fair.
13:04 <iFire> this system https://illumos.org/man/5/rbac
13:04 <micmus> I'm playing with beam assembly trying to optimise some common code that elixir compiler spits out
13:05 <benwilson512> OliverMT: ah yeah graphql makes that trivial
13:05 <benwilson512> because it resolves top down
13:05 <benwilson512> so if you don't have access to the thing at the top and you return an auth error at that level then there's nothing to resolve off of
13:05 <benwilson512> so it stops naturally
13:05 <benwilson512> you can do it in a fine grained way too via the same principle really
13:06 <OliverMT> halting at anywhere in the resolve chain will/can 403 the whole thing?
13:06 <benwilson512> ah no so
13:06 <micmus> It seems there's a lot of redundant instructions generated for maps https://gist.github.com/michalmuskala/d34df11a7ffc60efe30677e72c277e8c#file-test-ex
13:06 <benwilson512> if you switch to graphql you ditch using status codes to indicate document level information
13:06 <benwilson512> that particular field would have an error
13:06 <benwilson512> and you can even place numerical status code like errors
13:07 <micmus> e.g. https://gist.github.com/michalmuskala/d34df11a7ffc60efe30677e72c277e8c#file-elixir-test-s-L137-L141 - exactly the same test is done twice
13:07 <OliverMT> aha
13:07 <iFire> nox: illumos/solaris rbac is like the other production rbac system that works other than selinux. So someone at sun/joyent know their stuff. Considering this language controls their cloud above this the design should be fairly good.
13:07 <iFire> The other problem is that rbac in elixir is not that great.
13:07 <benwilson512> OliverMT: so you make a tree query and in the tree response if any point is unauthorized the sub tree under that node is gonna not resolve
13:07 <iFire> I can't find any that look good. Recommendations?
13:08 <benwilson512> and you'll get a reason why in the returned errors
13:08 <nox> iFire: Don't they already have languages on their own?
13:08 <iFire> ?
13:08 <benwilson512> but anything that you ARE authorized for will resolve
13:08 <nox> I'm just dubious at the whole "let's create a new one".
13:08 <nox> iFire: Other rbac systems I mean.
13:08 <iFire> nox: then again joyent's smartos uses nodejs in the system
13:08 <iFire> it is literally a system language
13:09 <nox> iFire: 53 bits ought to be enough for everything.
13:09 <iFire> https://illumos.org/man/5/rbac <- probably written in the kernel
13:09 <iFire> like c
13:09 <nox> (https://twitter.com/antumbral/status/854437179292086273)
13:10 <iFire> I mean joyent funds or used to fund nodejs developement so it's not that big of deal
13:10 <benwilson512> micmus: context?
13:10 <benwilson512> also, how are you generating that?
13:11 <iFire> nox: Well I don't think there are any general purpose rbac systems that are like in nodejs or external to the kernel. You can't like get a implementation of selinux capabilities outside the kernel.
13:11 <iFire> I'll google
13:11 <micmus> benwilson512: that's the beam assembly, I generate it with this script https://github.com/michalmuskala/dotfiles/blob/master/erlang/bin/beam_decompile
13:12 <micmus> benwilson512: some idiomatic elixir constructs output beam code that could be heavily optimised
13:12 <micmus> the passes in OTP have those optimisations for many erlang idioms, but for obvious reasons not for elixir ones
13:13 <iFire> nox: Looked into CanCan btw it seems like the most popular elixir option
13:13 <iFire> https://hex.pm/packages/canada
13:13 <benwilson512> micmus: oh man those things look like they would help Absinthe a lot
13:14 <iFire> https://github.com/cpjk/canary
13:14 <micmus> benwilson512: I'm not sure how big the speedup would be, but it would definitely help
13:14 <micmus> there's also some dead code that could be eliminated with those optimisations
13:14 <micmus> but I'm just discovering my way around the compiler :( There's little to no docs
13:14 <benwilson512> well Absinthe is basically 99% map based tree walks
13:15 <micmus> I already submitted one PR today to improve the type-based optimisations https://github.com/erlang/otp/pull/1414 primarily for binary matching
13:17 JEG2 joined
13:17 <micmus> Also a lot of the compiler passes use orddicts/gb_trees - I bet they would be faster with maps
13:17 mhutter joined
13:17 mhutter joined
13:18 gvaughn joined
13:22 <benwilson512> faster compiler would be great
13:22 bturnbull joined
13:22 <* nox> cries.
13:22 <nox> benwilson512: Faster erlc?
13:22 <nox> Oh did you mean that produces faster code?
13:22 <benwilson512> faster erlc
13:22 <benwilson512> but I mea
13:23 <benwilson512> *mean, it's all relative I know
13:23 <nox> Ok, then I cry, erlc is fast. :P
13:25 <micmus> faster code is my primary target
13:25 <benwilson512> yea
13:26 <OliverMT> how about faster coding? anyone got something for that?
13:27 <iFire> wait is faster coding like when you go slow and write less bugs :P
13:27 <nox> iFire: No it's when your language lets you write fn instead of fun.
13:28 <dmilith> learn macros..
13:28 <dmilith> and you can do that ^^
13:30 <benwilson512> real men do it with sed
13:31 r00tl3ss joined
13:32 <r00tl3ss> Hey guys, this NPM bullshit is really pissing me off. How would I use, say npm's "camelcase" module inside my phoenix app?
13:32 <seancribbs> r00tl3ss: `npm install --save camelcase`
13:32 <r00tl3ss> done that
13:33 <seancribbs> ok, did you `require` or `import` it?
13:33 <benwilson512> in the JS code served by phoenix?
13:33 <benwilson512> or in the elixir code?
13:33 <r00tl3ss> I tried const camelCase = require('camelcase');
13:33 <r00tl3ss> didn't work
13:33 <r00tl3ss> i put it in app.js
13:33 <seancribbs> import camelCase from "camelcase"?
13:33 <r00tl3ss> i tried import "camelcase"
13:33 <seancribbs> hmm
13:33 <r00tl3ss> tried that too
13:33 toastytheog joined
13:33 <Nicd-> camelcase is the actual module you are having trouble with?
13:33 milad joined
13:34 <seancribbs> https://www.npmjs.com/package/camelcase ?
13:34 <r00tl3ss> No....was actually trying to use dependent-select-boxes
13:34 steffkes joined
13:34 steffkes joined
13:34 <r00tl3ss> but was having trouble trying to get it to work
13:34 <r00tl3ss> am trying camelcase just to figure out this NPM nonsense
13:34 <r00tl3ss> since it should be pretty straight forward
13:34 <r00tl3ss> but NPM is anything but straight forward
13:35 <Nicd-> import DependentSelectBoxes from 'dependent-select-boxes';
13:35 Guest67 joined
13:35 <Nicd-> if you want to set the default options, import {setDefaultOptions} from 'dependent-select-boxes';
13:37 <r00tl3ss> that gives me app.js:79 Uncaught Error: Cannot find module "dependent-select-boxes" from "web/static/js/app"
13:37 <r00tl3ss> there MUST be something I'm missing here
13:37 <Nicd-> then your brunch is not set up properly
13:37 <r00tl3ss> everywhere I look, they say import this or that
13:37 <r00tl3ss> but it doesn't seem to work for me
13:37 <Nicd-> that is the correct import
13:37 <Nicd-> but your buildtool is not looking in node_modules to find it
13:38 <r00tl3ss> I've got a joinTo for my node_modules stuff
13:38 chrismccord joined
13:38 <r00tl3ss> hang on
13:38 <Nicd-> unfortunately brunch is totally opaque to me and I have no idea how to use it
13:38 <r00tl3ss> Neither have I
13:38 <r00tl3ss> to be honest, any of this JS bullshit seems like so much magic
13:39 <r00tl3ss> straight up JS is alright
13:39 <r00tl3ss> but then you have these stupid js builder things like bower and brunch and npm and suddenly you need some kind of secret that everyone knows
13:39 akeating joined
13:40 <r00tl3ss> except yourself
13:40 <Nicd-> that's why I wrote my own thing in Elixir :D
13:40 <Nicd-> so I don't have any magic
13:40 <r00tl3ss> I have another phoenix project where I wrote some "Load certain js things by page view"
13:41 <r00tl3ss> and that seems to work better than this brunch bullshit
13:41 <sevenseacat> and it probably has 1% of the functionality
13:41 <chrismccord> r00tl3ss did you use render_existing to accomplish it?
13:42 <sevenseacat> if you dont want to use brunch, don't use it
13:42 <Nicd-> this is what my blog's build system looks like now (handles JS and SCSS and has watch support): https://bitbucket.org/vincit/mebe/src/719f6b525e0a9970a4178c4ffed2c9f60547959c/lib/mix/tasks/?at=master
13:42 <Nicd-> the price you pay for no magic is verbosity
13:45 <r00tl3ss> chrismccord: I believe so.
13:45 <r00tl3ss> chrismccord: yes, it's the render_existing one that works a bit better (and seems a lot clearer to me)
13:46 maxbeizer joined
13:48 seancribbs joined
13:49 icapurro joined
13:49 icapurro joined
13:50 milad joined
13:50 milad joined
13:51 gvaughn joined
13:51 <drewolson> benwilson512 do you have time for / can you help with a relay-specific graphql question?
13:54 egis joined
13:57 milad joined
13:57 milad joined
14:01 aeliton joined
14:02 akeating joined
14:04 duane joined
14:07 jkreeftmeijer joined
14:07 akeating joined
14:09 akovari joined
14:13 steffkes joined
14:13 cdg joined
14:14 codestorm joined
14:15 seancribbs joined
14:20 <benwilson512> drewolson: I can try, but I don't do a lot on the front end
14:20 <benwilson512> you may have more success in the absinthe-graphql room itself
14:20 <drewolson> benwilson512 ah, is that on irc? or slack?
14:21 <cristianR_> Hello
14:21 Guest67_ joined
14:21 <benwilson512> drewolson: slack
14:21 <cristianR_> I'm having issues using HTTPoison in combination with hackney pools
14:22 <drewolson> benwilson512 ah, bummer, ok.
14:22 <drewolson> benwilson512 i'm asking in the #graphql freenode channel, we'll see how that goes. this is actually an API design question rather than a front end question.
14:22 <benwilson512> gotcha
14:22 <drewolson> essentially i have no idea how nested connections are supposed to work with arguments
14:22 <cristianR_> The requests seems to stop working at some point after a period of heavy request load
14:23 <drewolson> benwilson512 like suppose you have a nodes endpoint that returns a PeopleConnection, and each person has an AddressConnection for addresses. what am i supposed to do with arguments to that nested address connection?
14:23 snappy_ joined
14:23 <drewolson> the cursor provided would only be applicable to a single parent person's addresses
14:23 <benwilson512> ah
14:23 <benwilson512> yes that's a great question
14:24 <drewolson> the github API seems to allow these arguments too, but i have no idea what they should do from a "semantic" perspective
14:24 <benwilson512> I'd ask in #graphql ;)
14:24 <benwilson512> no idea
14:24 <drewolson> cool, thanks :)
14:24 <drewolson> right now i'm considering ignoring arguments if the node is nested inside another connection
14:24 <cristianR_> benwilson512: are you still experiencing issues with hackney pools?
14:24 <snappy_> Hi everyone, what's the best way to learn Ecto? I'm in a strange spot because I kinda-sorta feel like I know Ecto, SQL, and Postgres, but I don't know what I don't know. Any recommended tutorials/books for Ecto/SQL/Postgres?
14:25 <benwilson512> cristianR_: it only happened back when doing lots of deletes
14:25 <iFire> can you describe or link to a page that explain why you would use graphl over rest/json; grpc and thrift?
14:25 <benwilson512> httpoison wasn't reading the body
14:25 <benwilson512> what version of httpoison are you on?
14:25 <iFire> snappy_: do you have any phoenix application ideas?
14:25 <benwilson512> iFire: yeah sure
14:25 <cristianR_> benwilson512: 0.10.0
14:25 <snappy_> iFire: Yup. Should I just build something, haha?
14:26 <iFire> I was planning on going to phoenix and implementing a simple site that does one to one, one to many and many to many relationships with like a uuid key
14:26 <iFire> snappy_: you might want to try that
14:26 <iFire> the default is one to one relationship and integer ids
14:26 <benwilson512> cristianR_: I'd start by updating httpoison although I think by that version it was fixed
14:27 <snappy_> iFire: sounds like a plan, thanks
14:27 <cristianR_> benwilson512: it looks like the requests never go through, but they do not timeout neither
14:29 <cristianR_> ericmj: Do you still disable hackney pools in Hex.pm?
14:29 <iFire> snappy_: also ex_admin is a cool tech
14:29 <iFire> https://github.com/smpallen99/ex_admin
14:29 <iFire> and you can try adding googel authentication and some sort of authorization (think user groups and roles)
14:30 <iFire> google*
14:30 <ericmj> cristianR_: yes, but i havent tried using pools recently
14:30 icapurro joined
14:30 <ericmj> but i dont think very much has happened regarding pools in hackney
14:31 <ericmj> they have some flaws and are not very well tested in my experience
14:32 <cristianR_> ericmj: after a burst of requests, it looks like hackney stops issuing them, and the timeouts crash all get_servers and supervisors :S
14:32 <cristianR_> thanks for the insight
14:32 <ericmj> yes, that's the same issues i have had
14:32 <ericmj> also, the lack of timeouts in some places can get the entire pool deadlocked
14:34 r00tl3ss joined
14:34 <cristianR_> ericmj: may I ask how did you ensured that the pools are not used by hackney?
14:34 douglascorrea joined
14:35 <snappy_> What's the best way to visualize the structure of params map in phoenix?
14:35 jleon joined
14:37 <ericmj> cristianR_: actually i dont know
14:37 <ericmj> benwilson512: does ex_aws use hackney pools?
14:37 milad joined
14:37 milad joined
14:38 <iFire> snappy_: observer is cool
14:38 <benwilson512> ericmj: I believe we re-enabled it yeah
14:38 <iFire> but it's for processes
14:38 <benwilson512> particularly now that ex_aws depends on hackney directly
14:38 <iFire> http://erlang.org/doc/man/observer.html
14:38 <benwilson512> instead of via httpoison
14:38 <benwilson512> snappy_: just IO.inspct ?
14:38 <benwilson512> IO.inspect rather
14:39 <ericmj> cristianR_: so i guess hexpm uses hackney pools ^
14:40 Thinh joined
14:41 <cristianR_> ok, thanks again for the input
14:41 <snappy_> benwilson512: okay, this may sound stupid, but would it be best to do this via iex query? pry in source?
14:41 <benwilson512> snappy_: you're talking about the params in a controller?
14:41 <snappy_> benwilson512: yeah
14:41 <benwilson512> I just put a `params |> IO.inspect` in the controller, hit it with a request
14:41 <benwilson512> and then look at the log output
14:42 <benwilson512> I suppose I could pry if I wanted to explore it but in general printing it out is enough
14:42 <snappy_> benwilson512: cool, thanks!
14:43 icapurro joined
14:44 cevado joined
14:49 jkreeftm_ joined
14:51 <snappy_> benwilson512: just noob-checking here...`conn.params` is separate from second-argument `params` in phoenix controller, right?
14:51 <benwilson512> they're the same thing
14:52 milad joined
14:52 milad joined
14:52 <snappy_> benwilson512: so second-argument `params` just pulls it out of the conn?
14:52 <benwilson512> yup
14:52 <benwilson512> for convenience
14:53 <snappy_> benwilson512: gotcha. mental model updated. :)
14:53 <benwilson512> it lets you basically just treat the conn as opaque 99% of the time
14:56 <gazler> https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/controller/pipeline.ex#L34
14:58 rschmukler joined
15:01 bpmcd_ joined
15:03 <snappy_> benwilson512: I came across this code on an elixir tutorial: https://gist.github.com/anonymous/eaf6719719407776163ac613f3ed86fc Could this be refactored to: https://gist.github.com/anonymous/a527a47f9b21e84b4bb0f9298dd60bb7 ?
15:03 <benwilson512> ah so
15:04 <benwilson512> there's a different thing happening here
15:04 <benwilson512> controllers are a specialized version of what is called a `Plug`
15:04 <benwilson512> plugs are simple functions that take `conn` as the first argument, and then a keyword list of options as the second
15:05 <benwilson512> a controller module is a plug, but the code for the main plug callback is injected by the `use Phoenix.Controller`
15:05 <benwilson512> it then dispatches to your particular action function
15:05 <benwilson512> and THAT is where the params get pulled out
15:06 <benwilson512> when dealing with ordinary plug functions all you get is the `conn` as the first argument with nothing pulled out, and then any options that the plug was configured with
15:07 rschmukler joined
15:09 LastWhisper____ joined
15:12 <snappy_> benwilson512: trying to understand this...so params don't get pulled out for custom plugs defined in the controller that aren't directly routed to?
15:22 ikcerog joined
15:24 icecreamcohen joined
15:25 icapurro joined
15:25 icecreamcohen joined
15:26 icecreamcohen joined
15:29 tuacker joined
15:36 duane joined
15:44 cdg joined
15:46 cristianR_ joined
15:47 baweaver joined
15:48 whharris joined
15:50 jadlr joined
15:50 gokr joined
15:53 <Ankhers> micmus: I'm sure you are busy, but would you mind taking a look at https://github.com/elixir-ecto/ecto/pull/1984 when you get a chance?
15:59 smferris joined
15:59 imack joined
16:00 davidw joined
16:01 ejpcmac joined
16:02 codestorm joined
16:03 josevalim joined
16:07 steffkes joined
16:07 steffkes joined
16:13 icapurro joined
16:16 refriedchicken joined
16:17 vmoravec joined
16:20 amclain joined
16:26 cevado joined
16:27 jeffweiss joined
16:40 <Ankhers> josevalim: When you have some time, would you mind taking a look at https://github.com/elixir-ecto/ecto/pull/1984?
16:40 akeating_ joined
16:42 sfbw_ joined
16:43 <micmus> Ankhers: I'll review it later today
16:44 <Ankhers> micmus: Thanks!
16:44 asabil joined
16:45 meh` joined
16:48 sfbw joined
16:57 codestorm joined
16:57 bturnbull joined
16:59 milad joined
17:00 josevalim joined
17:01 cevado joined
17:04 milad joined
17:08 milad joined
17:09 cemilowski joined
17:11 Ioyrie joined
17:12 jkreeftmeijer joined
17:13 jkreeftmeijer joined
17:15 jkreeftm_ joined
17:18 squallstter joined
17:22 mika_ joined
17:22 cevado joined
17:23 greengriminal joined
17:23 seancribbs joined
17:27 rschmukler joined
17:27 cd-rum joined
17:30 mika_ joined
17:31 <ejpcmac> Hello! I’m trying to get my first Phoenix app to work correctly in release, and I have a problem with an `uploads` directory.
17:32 <ejpcmac> I have configure an ImageUploader with Arc to store the uploads in this directory, and my endpoint to serve it at /uploads. It works well in dev mod, but not in the release.
17:33 <ejpcmac> Is there a clean way to put in in the var directory? Or should I set a new option through Conform to set an absolute path somewhere in my filesystem?
17:36 nd___ joined
17:37 Cohedrin joined
17:39 akeating joined
17:40 <Ankhers> ejpcmac: Are you getting an error?
17:40 <ejpcmac> Not in the console, just a 404 in the browser
17:40 <Ankhers> Are the files actually being uploaded?
17:41 <ejpcmac> yes
17:41 <ejpcmac> and the `Path.expand("./upload")` in the console shows the good absolute path
17:41 <ejpcmac> And I tried again in dev mode, it works.
17:42 <ejpcmac> Just to precise: for the release, I’m talking about a distillery OTP release.
17:42 <asonge> ejpcmac: cwd isn't what you think it is in a release...
17:42 <asonge> right
17:43 <asonge> i would use the config (whether conform or regular) to set the path to some outside-of-app path (possibly in /var), if you want a stateful server
17:43 <ejpcmac> But Arc creates the file in the right place. Why the endpoint can’t find it?
17:43 <micmus> The only places where you can be sure of a location are either absolute paths or priv directory
17:43 <asonge> ^^^
17:43 <micmus> I would generally store uploads somewhere outside of the release completely
17:44 <ejpcmac> Ok, I think I’ll go for a /var, it is even cleaner
17:44 <asonge> yeah, it should always be safe to nuke a release directory and extract a new one without affecting anything
17:44 <Ankhers> Arc is uploading outside of the release, but the static plug is pointing to a different dir.
17:44 icapurro joined
17:46 <Ankhers> The static plug uses Application.app_dir(app) in order to know where to find the files. But because Arc is not uploading the files into that directory, you are having the issue.
17:47 <Ankhers> I believe Arc just creates the directory based on where you start the application from using Path.expand like you tried doing.
17:47 asabil joined
17:49 codestorm joined
17:50 MarioBranco joined
17:55 cevado joined
17:58 <ejpcmac> Ankhers: Thank you for the explanations!
17:59 <ejpcmac> Also, another problem: Conform does not seem to be very UTF-8-friendly.
17:59 <ejpcmac> Whenever I put a « é » in my .conf, it get a fatal exit.
18:01 <ejpcmac> Oh, it works, but without quotes. Strange.
18:07 <ejpcmac> Edit: No, it does not work properly. Without quotes Conform does not crash, but the é gets encoded by 233, so it seems it is some Latin-1 value.
18:09 icapurro joined
18:19 <ejpcmac> Writing the configuration in “hard” in the config.exs is even worse: conform seems to translate it to Latin-1, so the VM crashes at start for a bad encoding.
18:20 <ejpcmac> Any idea how I can get in work?
18:20 ZippoWeb joined
18:21 <Nicd-> maybe related? https://github.com/bitwalker/conform/issues/101
18:22 <ejpcmac> Nicd-: Yes, it seems. I’ve searched in the issues for UTF-8 but not utf8
18:22 <bitwalker> ejpcmac: if you open a PR with a test schema/config and a case which produces it, I'll work on it this afternoon if you like
18:23 jkreeftmeijer joined
18:24 hbraun joined
18:24 <ejpcmac> bitwalker: I just need to fork and put a schema with an UTF-8 é in conform/test/shemas, right?
18:24 steffkes joined
18:26 msantos joined
18:26 <bitwalker> ejpcmac: yeah, a schema in conform/test/schemas, a .conf in conform/test/confs, and a config.exs in conform/test/configs - see readme_example-named things as a reference. This way I can test the various stages of config handling with your issue
18:28 <ejpcmac> bitwalker: Ok, thank you! I’ll do it now.
18:28 asabil joined
18:29 rschmukler joined
18:34 cemilowski joined
18:41 Ioyrie joined
18:42 haste joined
18:42 rschmukler joined
18:46 seancribbs joined
18:57 hbraun joined
19:00 greengriminal joined
19:00 Sentreen joined
19:01 TinkerTyper_ joined
19:02 <Sentreen> Stupid question: I'm using `Slave.start(host, 'shortName')` to start remote elixir nodes. Is there any way to make them load a particular module?
19:06 brohith joined
19:07 icapurro joined
19:11 icapurro_ joined
19:15 duane joined
19:20 marr joined
19:21 maxbeizer joined
19:23 <brohith> hey y'all, is there any way to override a poison encoder and still compile with exrm or distillery?
19:24 siruf_ joined
19:38 sekjun9878 joined
19:38 sekjun9878 joined
19:43 wsieroci joined
19:45 pcre joined
19:45 codestorm joined
19:46 brohith_ joined
19:48 icapurro joined
19:52 gvaughn joined
19:53 gvaughn_ joined
19:54 <bitwalker> brohith_: it should compile fine as-is, what's happening?
19:58 hahuang65 joined
20:03 cemilowski joined
20:10 mika__ joined
20:18 <Ilyes512> is it possible to insert multiple changesets that are stored in a list?
20:19 <Ilyes512> I get "protocol Enumerable not implemented for #Ecto.Changeset<..."
20:19 stephen_m joined
20:20 Cohedrin joined
20:21 <ejpcmac> I’m still trying to get the Plug.Static work in production. I have now an absolute path set in the application env. It works in dev, but not in prod despite I’ve set the exact same absolute path.
20:21 <hahuang65> Ilyes512: https://hexdocs.pm/ecto/Ecto.Repo.html#c:insert_all/3
20:21 <hahuang65> Ilyes512: sounds like you are trying to use Enum against a single Changeset.
20:22 <ejpcmac> Trying to do File.ls on this path in the console of the prod version works and shows me the file, but I still get a not found in the browser.
20:22 <Ilyes512> hahuang65 I was am looking at the exact same section
20:23 Leo_2425423_ joined
20:25 <hahuang65> Ilyes512: did you figure it out?
20:26 steffkes joined
20:26 <Ilyes512> nope still playing around with it... i will share what i have right now
20:27 Cohedri__ joined
20:28 <Ilyes512> hahuang65 this is what I got now
20:28 <Ilyes512> https://gist.github.com/Ilyes512/4dd91a35dc26610b9592def10c33f1f9
20:30 <hahuang65> and what's the error you're getting?
20:31 <Ilyes512> hnn
20:32 <Ilyes512> hahuang65 i have added the error to the gist (after reload you should see it)
20:33 <Ilyes512> so I know that structs dont implement the enumerable protocol, but I don't know how else to do this?
20:34 icapurro joined
20:34 <hahuang65> Ilyes512: it's not clear where the error is happening. My guess is that something is up because `insert_all` doesn't return anything, yet you are piping to Enum.map.
20:35 <Ilyes512> i am checking if it works if i just create a plain map fixture instead
20:36 <Ilyes512> oh right i already tried that
20:36 asabil joined
20:36 <Ilyes512> it was missing the timestamps so I would need to create those my self. hmm
20:37 <ejpcmac> micmus: How do you configure your endpoint to serve your uploads? It does not work in production for me even with an absolute path (where it works perfectly in dev with the exact same asbolute path)
20:37 <hahuang65> Ilyes512: take out |> Enum.map(&User.change/1)) from line 16 of seed.exs
20:37 <hahuang65> and try it
20:38 <hahuang65> I think you've got the wrong order. you want to put them all thru Ecto.Changeset BEFORE you do insert_al
20:38 <hahuang65> Ilyes512: or just build the changeset in `fixture` function
20:39 <Ilyes512> i got something working now. just not ideal
20:40 <Ilyes512> if you reload you now see a seed2.ex
20:40 jkreeftmeijer joined
20:41 <Ilyes512> so I had to create the timestamps (as those cant be null). I prefer to use a changeset
20:43 jkreeftm_ joined
20:44 <hahuang65> Ilyes512: you can still use changesets.
20:44 <hahuang65> Ilyes512: just put it before the insert_all. you had insert_all |> changeset, but you need |> changeset |> insert_all
20:44 <Ilyes512> oh i got something working with changeset
20:44 <hahuang65> or just build your fixture function to already call changeset.
20:45 <Ilyes512> yes i did put the changeset in the fixture(:user) and now it works
20:45 <Ilyes512> I will check if changing the order also fixes it
20:45 lexmag joined
20:45 <hahuang65> Ilyes512: your order was wrong, you don't need to put it in a changeset if it's already in the database...
20:46 <hahuang65> I don't know if I'm making sense to you lol
20:46 brohith joined
20:46 <Ilyes512> yes i do. just now that last part, cause I am seeding users for local dev. So there are no users
20:46 <Ilyes512> but you are right about the order.
20:47 <Ilyes512> i am trying to do that now
20:47 <hahuang65> cool, good luck
20:49 rschmukler joined
20:49 egis joined
20:50 maxbeizer_ joined
20:50 sfbw joined
20:55 ramortegui joined
21:03 cdg_ joined
21:06 <Ilyes512> hmm still can't get it to work
21:06 <Ilyes512> https://gist.github.com/Ilyes512/4dd91a35dc26610b9592def10c33f1f9
21:06 jkreeftmeijer joined
21:06 musicnode joined
21:06 <Ilyes512> i does work when i use insert! (one at a time)
21:20 seancribbs joined
21:22 gokr joined
21:37 <adamkittelson> benwilson512: went on a dependency updating spree this week and noticed ex_aws parses sqs responses now 👍
21:42 ultra|lazer joined
21:46 seancribbs left
21:47 duane joined
21:49 jdqx joined
21:52 <Ilyes512> is it possible to change a elixir config from a call inside a module
21:52 <Ilyes512> ie when i seed i wan to set config :comeonin, :bcrypt_log_rounds, 4
22:02 <benwilson512> adamkittelson: ah yes, a contribution I believe
22:04 PaReeOhNos joined
22:06 <ultra|lazer> Any seattle area elixir devs around here?
22:08 brohith joined
22:14 Ilyes512 joined
22:16 cdg joined
22:16 icapurro joined
22:17 greengriminal joined
22:24 mhutter joined
22:26 dimitarvp` joined
22:26 steffkes joined
22:27 <alisdair> how seattle area? i'm ~2.5 hours away
22:28 <benwilson512> alisdair: you gonna be at elixirconf US in bellview?
22:29 <alisdair> maybe. i am planning on it, but i'm also moving to the east coast this summer
22:29 <benwilson512> oh cool, where to?
22:29 <alisdair> toronto
22:29 <benwilson512> oh very nice, we do some business there
22:30 <benwilson512> which is to say, I've seen mostly just their warehouse district :S
22:30 <alisdair> i hate toronto, but my girlfriend's career doesn't care ;)
22:30 <benwilson512> haha
22:31 <alisdair> i already told her it's denver or the west coast or we're done for our next move ;)
22:31 <benwilson512> heh, yeah I haven't spent much time on the west coast sadly
22:32 <benwilson512> couple years back I bicycled from w
22:32 <benwilson512> Washington, DC to Seattle
22:32 <benwilson512> which was my first time out west
22:32 <benwilson512> ended up visiting portland too, weird place
22:32 <benwilson512> loved it
22:34 icapurro joined
22:34 mika__ joined
22:34 <alisdair> i grew up in california and british columbia, and weather everywhere else in the world seems intolerable
22:37 toastytheog joined
22:43 <benwilson512> heh
22:45 steffkes joined
22:45 steffkes joined
22:54 asabil joined
23:04 jhack joined
23:07 jkreeftmeijer joined
23:11 samgaw_ joined
23:12 <johnhamelink> Hey folks. How can I count how many times my test has received a message?
23:16 rozap joined
23:19 refriedchicken joined
23:21 ejpcmac left
23:26 <rozap> is there any way in phoenix to go from route as a string to controller+action?
23:28 <rozap> use case: i have a plug which counts response codes and sends them to our metrics stack. our metric path looks something like app_name.api.#{controller}.#{action}.#{status_code} - but we have some plugs which do auth and may halt the plug pipeline before phoenix ever matches the URI to a Controller+action
23:28 <rozap> so the auth plug may halt the connection with a 403 and, but i have no way of generating the metrics key for that request
23:29 <rozap> because no controller or action have been set yet
23:29 jmiven joined
23:33 <chrismccord> johnhamelink `for _ < 1..5, do: assert_receive(:foo)`
23:34 <chrismccord> rozap : no good way. action isn't even set until controller dispatch since our router really routes to plugs
23:34 <johnhamelink> chrismccord :: >_> I was overthinking it :) Thanks
23:34 samgaw joined
23:35 strykerkkd joined
23:35 mhutter joined
23:36 nd__ joined
23:36 rschmukler joined
23:41 samgaw joined
23:44 <ultra|lazer> I live near Bellevue, when is elixircon?
23:48 <ultra|lazer> Ahh September
23:48 <ultra|lazer> Quite a ways away
23:50 <rozap> chrismccord: hrm, bummer. ok - that makes sense though, thanks!
23:51 <rozap> i was hoping for some magic function that would tell me "which controller+action would this string match" but i guess all those matchers are generated to match on actual connections
23:52 mika__ joined
23:53 musicnode joined
23:54 musicnode left
23:56 laut joined