Open chronark opened 7 months ago
Hey, I have a doubt, created a new root key and I feel it's depend on the backend. is'nt it ?
can you elaborate?
I tried to create a root key for test the speed, I feel UI updation slow because of backend response. correct me if I am wrong please.
yes it's the backend that is slow, I linked the code above
So that means, we have to optimize the backend as well ?
the only bottleneck is in the backend, the ui just sends a trpc request
Thanks for clearing. It takes some time understand the problem statement. Got it now, Can I work on that or someone from unkey is already working upon that?
sure, go ahead
hey @chronark, As mentioned above We're looping through all required permissions and doing a network roundtrip for each., I guess your talking about
we can make use of Promise.all() for concurrently doing a network request
Is this related as mentioned above or i am going in wrong direction ?
Yeah, I deliberately didn't do a promise.all, cause apparently that's an issue with planetscale
I haven't looked much deeper though and just accepted that it might be a bit slower for now.
I'm reworking permissions a little bit right now, and adding roles, potentially we don't even need to upsert in parallel anymore
Preliminary Checks
Reproduction / Replay Link (Optional)
No response
Issue Summary
We're looping through all required permissions and doing a network roundtrip for each. https://github.com/unkeyed/unkey/blob/6c516c33db02312dd95a10db64941500365154d1/apps/web/lib/trpc/routers/permission.ts#L123
Steps to Reproduce
Expected behavior
It should be much faster
Other information
No response
Screenshots
No response
Version info