Fix/invalidate node rights cache flush #7280
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 does not change the caching mechanism, instead in the case of a mesh change, it will dump the cache for all users. The alternative is to iterate over all cache entries, which seems like a bad idea. However, this will cause a bunch of cache misses every time a user has their permissions changed, which is not ideal either.