Skip to content

NotificationCenter: inbox shows groups and notifications of features the tenant has not enabled #355

Open

Description

@duguankui

Problem

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

  1. added
    bugSomething isn't working
    module: notificationsChanges under notifications/ (Dignite.Abp.Notifications / Dignite.NotificationCenter)
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmodule: notificationsChanges under notifications/ (Dignite.Abp.Notifications / Dignite.NotificationCenter)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions