Skip to content

Conversation

@HuFlungDu
Copy link
Contributor

Invalidate GetNodeRightsCache entries when a user's permissions on a device or mesh.

This is a proposal for #7274.

In short, changing permissions can invalidate cache values, causing some users to not get permissions they should, or causing a user to continue having permissions for 10 seconds after they are removed from a device/mesh.

This version uses a hierarchal cache in order to allow cache invalidations for various scopes (user, mesh, device). The upside is that it allows us to empty the cache selectively based on what permissions are modified. Downside is the cache lookup is a bit more complicated (time should be about the same since there's no strcat happening), and cache invalidation of the entire user needs to iterate over all its children in order to do a correct cache count manipulation. This could be avoided if we were just fine with cache count being wrong and flushing slightly more often, but I didn't want to make that executive decision.

@si458
Copy link
Collaborator

si458 commented Sep 19, 2025

if you happy for me to merge this then plz change to ready :)

@HuFlungDu HuFlungDu marked this pull request as ready for review September 24, 2025 18:32
@HuFlungDu
Copy link
Contributor Author

I guess I prefer this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants