Hi there, Im transferring my question from <#C02TV...
# permit-saas
y
Hi there, Im transferring my question from #C02TVG7RY1X ------------ Hi guys, I am experiencing a problem now: We have a backend call to
permit.getUserPermissions(id)
through the sdk, and it will return a full list of permission to the front end to render the items. Previously when we changed the roles of a user, the changes in the permission returned from that call also happens near real-time/immediately, but starting yesterday the
getUserPermissions
only returns the correct permission after around 5 mins approximately (different every time) after we changed the roles. Do you know why ? It looks like the rendering of the roles on permit.io side has some issue and propagation of the policy to our PDP is delayed
a
Hi @Yoong Jia, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
This sounds like a policy synchronization delay issue. The
getUserPermissions
function retrieves all user permissions across registered resources and tenants (1) . When you update roles, these changes need to propagate from Permit.io's control plane to your Policy Decision Point (PDP) . To help our engineers investigate this delay issue, could you please provide: 1. ​*Which Workspace / Project / Env you are using*​ - This helps identify your specific configuration 2. ​*What calls you are performing*​ - Please share: • The exact SDK code for your
getUserPermissions
call (e.g., in Node.js it would be:
await permit.getUserPermissions(user) ;
) • How you're updating the roles (SDK code or API calls) 3. ​*Which PDP version you are running*​ - Check your PDP container/deployment version 4. ​*Relevant logs from your PDP*​ - Particularly any logs showing: • When role updates are received • Any errors or warnings during synchronization • Timestamps of when permissions queries are made The 5-minute delay suggests there might be an issue with the real-time policy/data streaming to your PDP. Your PDP should receive updates via OPAL's WebSocket connection for near real-time synchronization (2) .
To learn more, see the sources I considered: [[1] Advanced Authorization Queries](https://docs.permit.io/overview/advanced-authorization-queries) [[2] Policy as Code | From Infrastructure to Fine-Grained Authorization](https://www.permit.io/blog/policy-as-code-or-from-infrastructure-to-fine-grained-authorization)
Also are the delays ongoing, or was this intermittent?
y
for the
proxyFactsViaPDP
it might be true but we are pretty sure that the whole flow was working fine for months, and there is no update to the flow from our backend as well. The issue only emerges yesterday
o
100% - That's why I asked for that additional information, so we can investigate
y
Sorry I overlooked the query above. The delay is happening ongoing.
a
Hey @Yoong Jia , We’re investigating your delay problem, Will be back to you (:
o
To be clear we still need those PDP logs, the workspace/project/env name, and an example of a delayed change
@Yoong Jia
@Yoong Jia we do see some spikes in update latency yesterday, but nothing as long as 5 minutes. We really need those logs in order to provide additional help.
y
Hi Sir, was away from keyboard just now
How do I get the log ?
You mean the log directly from the PDP ?
I just checked again, looks like the latency has dropped to normal one we had, thanks for the help ! I will attach the log here soon if I hit the delay again here
👍 1
o
You mean the log directly from the PDP ?
Yes
I just checked again, looks like the latency has dropped to normal one we had, thanks for the help ! I will attach the log here soon if I hit the delay again here
Alright, please do consider using the consistent updates feature regardless, this will make your system more fault tolerant
✅ 1