Fork me on GitHub
#pathom
<
2019-07-01
>
souenzzo15:07:10

I'm getting some errors like this {:clojure.spec.alpha/problems ({:path [:app :com.wsscode.pathom.connect/plan], :pred clojure.core/vector?, :val :my-app/some-key-from-query... Is it a know issue?

wilkerlucio16:07:24

not known, but I guess it may happen as part of a change I did recently, are you on the latest?

wilkerlucio16:07:49

but could also be a legit detection, can you tell me more about this case?

souenzzo17:07:26

Okay. I will try to reproduce a small case]

souenzzo17:07:07

(let [register [(pc/resolver `foo
                             {::pc/output [::foo]}
                             (fn [env _]
                               (s/explain (s/keys) env)
                               {::foo 33}))]
      plugins [(pc/connect-plugin {::pc/register register})]
      parser (p/parallel-parser {::p/plugins plugins})]
  (async/<!! (parser {::p/reader [p/map-reader pc/parallel-reader]}
                     [::foo])))

souenzzo17:07:04

In "real world" it occours when my-function is instrumented

(fn [env _]
  {::foo (http/my-function env ..)}

wilkerlucio18:07:33

that seems a bug in the specs, let me debug that here, should be simple to fix

👍 4
wilkerlucio18:07:01

yeah, I think I get it, the problem I'm using ::pc/plan improperly... the ::pc/plan is supposed to be a collection of paths to follow, in this case I'm using ::pc/plan as a single path (instead of a collection)

wilkerlucio18:07:24

I'll see if its easy to replace the usage to ::pc/plan-path, which is the correct name for it

wilkerlucio18:07:08

I started to run things instrumented only recently, thanks for pointing the bad spec

👍 4
wilkerlucio18:07:47

please let me know if you find any other issues with [2.2.17]

souenzzo19:07:09

already running 2.2.17 in homolog env 😅 also removed some random (dissoc ::pc/plan) from code

kszabo16:07:43

hey, I just opened a ticket for a potential improvement for Pathom: https://github.com/wilkerlucio/pathom/issues/98 any1 interested?

wilkerlucio18:07:24

[com.wsscode/pathom "2.2.17"] is out! Library Changes: - Looser spec on ::pc/transform - Use contains? instead of find in map reader to support wider range of custom maps - BREAKING: Fixed specs, when processing a plan path, use ::pc/plan-path instead of ::pc/plan in the env, which is the correct name

wilkerlucio18:07:10

that breaking, you are only affected if you happen to use ::pc/plan from the env for any custom extension