-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Provide a way to clear the application configuration cache for all users.
#24486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to clear the application configuration cache for all users.
#24486
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the application configuration cache invalidation mechanism to support clearing cache for all users, not just the current user. It introduces an optional UserId parameter throughout the cache reset infrastructure: when null, it clears cache for all users by removing a version cache key; when provided, it clears cache for a specific user.
Key changes:
- Added
UserIdproperty toCurrentApplicationConfigurationCacheResetEventDatato support user-specific or global cache invalidation - Implemented version-based cache key generation using
MvcCachedApplicationVersionCacheItemto enable clearing cache for all users - Updated permission management modals to pass user ID when resetting cache after user permission changes
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CurrentApplicationConfigurationCacheResetEventData.cs |
Added optional UserId property and constructor to support both user-specific and global cache reset |
MvcCurrentApplicationConfigurationCacheResetEventHandler.cs |
Updated to handle both user-specific cache removal and global cache invalidation via version cache |
MvcCachedApplicationVersionCacheItem.cs |
New cache item to track application version for global cache invalidation |
MvcCachedApplicationConfigurationClientHelper.cs |
Refactored from static to instance class with version-based cache key generation |
MvcCachedApplicationConfigurationClient.cs |
Updated to use helper instance and async cache key creation |
RemoteDynamicClaimsPrincipalContributorCache.cs |
Updated to use cache helper instance instead of static method |
ICurrentApplicationConfigurationCacheResetService.cs |
Added optional userId parameter to ResetAsync method signature |
BlazorServerCurrentApplicationConfigurationCacheResetService.cs |
Updated to pass userId to event data |
BlazorWebAssemblyCurrentApplicationConfigurationCacheResetService.cs |
Added userId parameter (though implementation doesn't use it) |
NullCurrentApplicationConfigurationCacheResetService.cs |
Added userId parameter to maintain interface consistency |
MauiCurrentApplicationConfigurationCacheResetService.cs |
Added userId parameter (though implementation doesn't use it) |
PermissionManagementModal.cshtml.cs |
Updated to extract and pass user ID when provider is UserPermissionValueProvider |
PermissionManagementModal.razor.cs |
Updated to extract and pass user ID when provider is UserPermissionValueProvider |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://abp.io/support/questions/10259
When an admin changes settings, features, or permissions, we need to clear the
ApplicationConfigurationDtocache for all users in MVC.If we can identify the target user(eg: change user permissions), we only need to clear their cache.