You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NotificationCenter: inbox shows groups and notifications of features the tenant has not enabled #355
On the "all notifications" inbox page (MVC /NotificationCenter/Notifications and the Angular notification-inbox component), every notification group is listed as a tab regardless of whether the current tenant has the feature that gates its notifications enabled.
Expected
The inbox should only show groups — and notifications — whose definitions are available to the current tenant, i.e. NotificationDefinition.FeatureName is enabled for it (and PermissionName is granted to the user). Groups and notifications from features the tenant has not enabled should not appear.
Where to look (not yet reproduced; read from the code)
UserNotificationAppService (notifications/notification-center/src/Dignite.NotificationCenter.Application/), which backs both UIs:
GetGroupsAsync computes availableGroupNames from DefinitionManager.GetAllAvailableAsync(userId) (feature + permission aware), but then includes a group when unreadCount > 0 || availableGroupNames.Contains(group.Name). A group with unread notifications is listed even when its feature is disabled for the tenant, so availability only gates groups with no unread items.
GetListAsync / ResolveGroupFilterAsync filter by group name against DefinitionManager.GetAllAsync() (every definition), never by availability. The "All" tab (GroupName == null) applies no name filter at all, and a group tab can be requested by name for a group the tenant has no access to. Notifications of unavailable definitions can therefore still be listed.
Worth checking separately why groups show up even with zero unread: NotificationDefinitionManager.IsAvailableAsync resolves IFeatureChecker from a fresh IServiceScopeFactory scope — confirm it still sees the current tenant in that scope (ambient ICurrentTenant) and in the demo host.
Suggested fix direction
Derive the visible set from GetAllAvailableAsync(userId) once and use it in all three places: the group list, the group filter, and the "All" filter (names outside the available set, including the synthetic "Other" bucket's exclusion list, should be treated consistently). Add tests in UserNotificationAppService_Tests with a feature-gated definition: tenant with the feature off → its group and notifications are absent; on → present.
Activity