Hi guys, I am experiencing a problem now: We have...
# general
y
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
o
Hi @Yoong Jia, we'd be right with you It is better to ask in #permit-saas to get a faster response from the team and our @Ask Inkeep
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
The delay you're experiencing with
getUserPermissions
returning updated permissions after role changes sounds like a synchronization issue between the Permit.io control plane and your PDP. To help resolve this, you can enable the ​*Read-Your-Own-Writes*​ feature which ensures immediate consistency after data changes (1) . This feature routes data change requests through the PDP and waits for them to be applied before responding . Here's how to enable it in Node.js:
Copy code
const permit = new Permit({
  token: "[your-api-key]",
  pdp: "http://localhost:7766",
  proxyFactsViaPdp: true
}) ;
With
proxyFactsViaPdp
enabled, API calls wait until data is fully synced to the PDP before returning, allowing immediate permission checks . To help our engineers investigate this issue further, could you please provide: 1. Which Workspace / Project / Env you are using 2. What calls you're performing (as SDK code or CURL) 3. Which PDP version you're running 4. Any relevant logs from your PDP This information will help us identify why
To learn more, see the sources I considered: [[1] Send Consistent Updates (Read-Your-Own-Writes)](https://docs.permit.io/how-to/manage-data/local-facts-uploader)
o
In general the AI is correct, the right way to synchronize data onto your PDP from your code on the fly, is via the consistent updates feature. Regarding changes in the synchronization time- please provide the following information for us to investigate: • Workspace/ Project / Env • PDP Logs from the relevant time • Example of an update you're preforming