This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-03
Channels
- # babashka (17)
- # beginners (166)
- # calva (97)
- # cider (4)
- # clara (2)
- # clj-kondo (46)
- # cljsrn (5)
- # clojure (334)
- # clojure-canada (1)
- # clojure-dev (144)
- # clojure-europe (14)
- # clojure-germany (5)
- # clojure-nl (10)
- # clojure-spec (1)
- # clojure-uk (46)
- # clojurescript (50)
- # conjure (1)
- # core-async (52)
- # core-typed (5)
- # cursive (3)
- # datomic (3)
- # emacs (11)
- # figwheel (16)
- # figwheel-main (9)
- # fulcro (29)
- # graalvm (19)
- # graphql (14)
- # helix (46)
- # hoplon (4)
- # hugsql (2)
- # jobs (2)
- # jobs-discuss (1)
- # juxt (15)
- # kaocha (6)
- # off-topic (9)
- # pedestal (7)
- # portkey (7)
- # re-frame (10)
- # reagent (29)
- # shadow-cljs (13)
- # spacemacs (70)
- # sql (13)
- # tools-deps (26)
- # xtdb (23)
I'm having a fun problem where grabbing a key out of a json response works fine locally but as soon as I push it through my cicd, it no longer does. Essentially, locally I have job-spec-id appropriately being set to a number, but remotely it gets passed along in this request as {job_spec_id: 1795} instead of just 1795. I've done everything locally the same way it seems, compilation config and everything. The only thing that i can think of that is different is that it's using https remotely vs http local. Anyone have any inklings of an idea? Starting to go nuts with this one.
(re-frame/reg-event-fx
::save-job
(fn [{db :db} [_ tms-id comp start-date end-date demos response]]
(let [job-spec-id (:job_spec_id response)]
{:http-xhrio {:method :post
:uri "/api/jobs"
:params {:user_id 2
:job_spec_id job-spec-id
:job_name "standard"
:job_type "standard"}
:format (ajax/json-request-format)
:response-format (ajax/json-response-format {:keywords? true})
:on-success [::request-unification tms-id comp start-date end-date demos job-spec-id]
:on-failure [::handle-error :program-metrics]}})))
Right now this is set up as a chained call from a previous api call. So it's essentially the response from another reg-event-fx that should have decoded it. (Not an ideal setup but it was what was there when i started working on this sadly)
by that i mean, save-job here is called on-success from another one
Hmm. Yeah, I'll doublecheck that the response is proper. Visually it looks the same but maybe it is encoded differently
Are their good reason to not include the track effect from re frame utiles into re frame?
@shanelester55 the problem is you cant mix snake and kebab cases like that for the same variable name. Clojurescript just munges the variable names unsafely, so you get issues
That part does seem to work but it's probably not best practice. I'll likely change it. I did end up fixing it for now, but it was something that I still can't quite explain. Our kubernetes deployment was somehow corrupted and this was the only thing that ended up being wrong. We copied our stuff to a new branch and redeployed and now everything works. very strange.