Fork me on GitHub
#datomic
<
2020-06-25
>
jeff tang19:06:36

hi! is it possible to retract a reverse-loookup attribute-value? e.g. [:db/retract 100 :_children 200]

favila19:06:06

[:db/retract 200 :children 100]

favila19:06:43

it’s not possible with an underscore attribute

👍 1
favila19:06:50

you have to reverse the terms

JAtkins19:06:47

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.

JAtkins20:06:43

Genius - thanks!

adamtait07:06:35

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.

adamtait07:06:51

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)!

souenzzo11:06:01

I do not use or recommended this CaSE sensitive solution. I just join the cookies with ;

adamtait01:06:07

@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).

JAtkins01:06:49

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?

adamtait20:06:11

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

👍 1
Pedro Silva20:06:13

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.

souenzzo00:06:08

One year ago I deployed a datomic-ions stack After fail 3 times in row I decided to not try updates anymore. Im really sad to see that they still fail at updates

😐 1