I'm not sure if I did something bad or not, but th...
# ory-network
c
I'm not sure if I did something bad or not, but the ory network permissions and tuples overview seems to misbehave madly in my current project. It seems every call (regular HTTP GET) to /relation-tuples returns a next_page_token pointing to itself, causing it to loop for ever and ever :)
Usually the page slows to a halt at around 100k tuples (which are the same 120 tuples or so, just listed like a thousand times ish)
s
so the response has the page token that the request was made with?
c
Oh man, I didn't check if it was actually in the request, but that was my working theory yes
I can try to recreate it to debug it further?
s
I need a request and response (can be obfuscated)
but the UI is very buggy right now... sorry for that
c
I'm on it boss! No worries, I don't really use the UI all that much, it's usually just to see the results of me testing things from the SDK
Obviously, I got pretty scared when I was testing permission tuple patching, checked the UI, and saw 103000 new entries 😛
Request:
Copy code
GET /relation-tuples HTTP/2
Host: redacted.projects.console.ory.sh
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: <https://console.ory.sh/>
Origin: <https://console.ory.sh>
Connection: keep-alive
Cookie: redacted
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
TE: trailers
(No body). Response:
Copy code
HTTP/2 200 OK
date: Tue, 14 Feb 2023 18:47:34 GMT
content-type: application/json; charset=utf-8
access-control-allow-credentials: true
access-control-allow-origin: <https://console.ory.sh>
access-control-expose-headers: Content-Type, Set-Type, Link, X-Total-Count
vary: Origin
cf-cache-status: DYNAMIC
server: cloudflare
cf-ray: 7997f917ea0bb518-OSL
content-encoding: gzip
X-Firefox-Spdy: h2
With body:
Copy code
{"relation_tuples":[ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ], "next_page_token": "dd39cc6b-3104-4341-b4b8-02df15095e4c"}
The full URI for the request is
<https://nostalgic-agnesi-otu9x8e3js.projects.console.ory.sh/relation-tuples>
, no query params
s
hm ok that looks legit
c
So your hunch is right, it seems the token is not included in the requests, unless it's really well hidden in a cookie or something
s
is the next one the same or does the next one have query params
c
They are all the same, I think this was number 25
s
should be in the query IIRC
c
Yeah, the SDK puts it in the query too
s
it is GET so yeah
tl;dr UI bug only 😅
c
Hahah, yeah, luckily
s
I think I found the issue the question is why tf is typescript happy with that???
the SDK expects an object with
pageToken
key
c
Well, there we go! Imagine if the signature of .getRelationships() had included the type of the input 😎
s
it does, that's why I am confused
c
Oh, yeah that's weird. I hate debugging the ts compiler, so I'm not envious of you at all right now 😄
s
haha yeah I just work around by adding more type annotations
c
Likewise - absolute pain in the ass though 😛
s
still better than no type annotations at all, 'cause then I would probably never have found that
c
Hell yeah, and way less work than writing up intricate stubs
Anyways, I'll let my guys know not to panic, and await the fix - which I guess will be out in like no time, seeing as you dudes are big fans of continuous deployment
s
yeah just writing e2e tests for this, how hard can that be...
c
Oh yeah, done in a jiffy 🙄
s
btw, fix should be live since yesterday
maybe you can check it out and see if it works?
c
I'd love to, but I'm at the hospital, scheduled for eye surgery in about an hour, so I'll have to stay away from screens for a couple weeks time 🙃. I'll defo get back to you if it still happens then though!
Thanks for the quick fix 😁
s
haha ok get well soon!
c
Thanks!