This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-25
Channels
- # announcements (5)
- # babashka (23)
- # beginners (70)
- # cider (24)
- # clj-kondo (14)
- # cljsrn (2)
- # clojars (6)
- # clojure (195)
- # clojure-australia (1)
- # clojure-dev (2)
- # clojure-europe (27)
- # clojure-france (1)
- # clojure-nl (4)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (12)
- # clojurescript (3)
- # clojurewerkz (1)
- # core-async (21)
- # cursive (9)
- # datomic (37)
- # duct (3)
- # emacs (16)
- # events (4)
- # fulcro (34)
- # graalvm (12)
- # javascript (3)
- # jobs (4)
- # malli (1)
- # meander (3)
- # nrepl (1)
- # off-topic (27)
- # pathom (16)
- # re-frame (17)
- # reagent (19)
- # rewrite-clj (18)
- # sci (47)
- # shadow-cljs (179)
- # spacemacs (18)
- # sql (52)
- # tools-deps (80)
- # vim (27)
- # vrac (1)
- # xtdb (9)
I see datomic cloud accepts frequencies
as an aggregate if :find
but I don’t see it documented, is that supported or some undefined behaviour? EDIT: doesn’t seem to return what I’d expect… weird that it’s accepted
I think you are accidentally using it as a custom aggregate: https://docs.datomic.com/on-prem/query.html#custom-aggregates
I think no-namespace symbols are interpreted as in clojure.core, so it happens to work
because it’s cloud (query is running on a different process than yours) there’s usually stuff you need to do to expose your fn to the query code
it didn’t get all the values I was expecting it to get… I’ll try it out again later if it should work
Perhaps I’m not understanding the cloud docs as they don’t mention the custom aggregates
(dc/q '[:find (frequencies ?b)
:with ?a
:in $ [[?a ?b]]]
db [[:a :A] [:a :Z] [:b :A] [:b :F]])
=> [[{:F 1, :A 2, :Z 1}]]
my frequencies is only getting one item so the result is always a mapping of {the-one-value 1}
hi! is it possible to retract a reverse-loookup attribute-value? e.g. [:db/retract 100 :_children 200]
thank you @U09R86PA4
Is it possible to respond to http ion requests with multiple "Set-Cookie" headers? My response using just ring wrap cookies looks like this:
"Headers": {
"Content-Type": "application/transit+json; charset=utf-8",
"Set-Cookie": [
"jwt-token=eyJraWQiOiJOM0pRej--retracted--sdfw;Path=/;HttpOnly;SameSite=Strict"
]
}
This works in ring since for seqs the header is translated to this:
Content-Type: application/transit+json; charset=utf-8
Set-Cookie: jwt-token=eyJraWQiOiJOM0pRej--retracted--sdfw;Path=/;HttpOnly;SameSite=Strict
However the ion spec only allows maps of string->string to be returned, and there is no way to set multiple cookeis with only one line in the header.This fix works great on Ions with Solo deploy or via Lambda, but it’s failing for me with http-direct.
{
:status 200
:headers {
"content-type":"application/json",
"Set-cookie":"b=cookie",
"set-cookie":"a=cookie"}
:body "{\"data\": \"stuff\"}"
}
This response from the http-direct handler results in the HTTP response:
< HTTP/2 200
< content-type: application/json
< content-length: 264
< date: Sun, 28 Jun 2020 07:30:54 GMT
< x-amzn-requestid: c3bc8a56-c0bf-41d7-b6b3-24292a2b6509
< x-amzn-remapped-content-length: 264
< set-cookie: b=cookie
< x-amz-apigw-id: O1APLEtPIAMFkGw=
< x-amzn-remapped-server: Jetty(9.4.24.v20191120)
< x-amzn-remapped-date: Sun, 28 Jun 2020 07:30:53 GMT
< x-cache: Miss from cloudfront
… only a single ‘set-cookie’ header when received by the client.I have also tried different variations of multiValueHeaders
(which is supported by API Gateway) but the Ions HTTP direct wrapper seems to ignore those.
Would love to hear if anyone else has seen this issue or worked around it (or if it really is a bug)!
I do not use or recommended this CaSE sensitive solution. I just join the cookies with ;
@U2J4FRT2T are you suggesting this?
:headers { "set-cookie": "a=cookie; b=cookie" }
I wasn’t able to find any documentation on combining multiple cookies in the same header but I tried it anyways and found that browsers ignore the 2nd cookie (`b=cookie` in this example).That’s part of the browser spec. I tried that at first. A new line is required for every cookie. Maybe a \n is needed?
Thanks for the idea! I wasn’t able to get \n
to work.
I posted the header inconsistency (between :lambdas
and :http-direct
to the datomic forum). Hopefully someone from the Datomic team will comment.
https://forum.datomic.com/t/inconsistency-between-lambdas-http-direct-multiple-headers/1506
Hello, I am executing the split stack process to be able to upgrade our Datomic version as described in: https://docs.datomic.com/cloud/operation/split-stacks.html#delete-master After start the delete process in CloudFormation we get an error as you can see in the image. Someone can help us to solve this problem and be able to continue the process? Thank you.