Skip to content

feat: notification system - #2721

Draft
kunal0137 wants to merge 5 commits into
devfrom
notifications-update
Draft

feat: notification system#2721
kunal0137 wants to merge 5 commits into
devfrom
notifications-update

Conversation

@kunal0137

@kunal0137 kunal0137 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Description

Reworks notifications around a canonical event model with per-user state and scoped retrieval. This adds application-scoped announcements that app owners and editors can publish to all current app members, while preserving the existing global notification bell flow.

Changes Made

  • Adds notification event, user-state, and delivery schema creation.
  • Adds canonical notification fields for audience, scope, priority, type, target, metadata, and display surface.
  • Adds per-user read and dismiss state, scoped to the authenticated recipient.
  • Updates notification retrieval and polling to support ALL, SYSTEM, and APP scopes.
  • Adds app-bound reactors:
    • CreateAppNotification(...)
    • FetchAppNotifications(...)
    • PollAppNotifications()
  • Derives app scope from the current insight for app-bound fetch/poll calls and verifies project view access.
  • Restricts app announcement creation to project owners and editors.
  • Updates engine/project permission-change notifications to use the new canonical notification model.
  • Adds DISPLAY_SURFACE support, with BELL as the current explicit default and room for future in-app surfaces such as modal, toast, and banner.
  • Scopes notification mutation operations to the authenticated user.

How to Test

  1. Build Semoss:

    cd Semoss
    mvn -q compile -DskipTests -Denforcer.skip=true -Dlicense.skip=true -Djacoco.skip=true
  2. As a project owner or editor, create an app announcement:

    CreateAppNotification(
      project = ["<project-id>"],
      title = ["Test announcement"],
      message = ["This is visible to current app members."],
      priority = ["NORMAL"]
    );
    
  3. Open the app as a user with project access and verify:

    FetchAppNotifications(limit = ["20"], offset = ["0"]);
    PollAppNotifications();
    

    The announcement should be returned and counted only within that app scope.

  4. Verify a user without project access cannot fetch app-scoped notifications or create an app announcement.

  5. Verify the platform notification drawer continues to use the global inbox:

    FetchNotifications(scopeType = ["ALL"]);
    PollNotifications(scopeType = ["ALL"]);
    
  6. Verify marking a notification read or dismissing it only changes state for the authenticated recipient.

Notes

  • App-bound fetch and poll derive the project from the current insight rather than accepting a caller-provided project id.
  • NOTIFICATION_DELIVERY defines the future external transport boundary for email, Slack, Teams, and webhooks. External delivery is not implemented in this PR.
  • User-provider identity backfill for ambiguous user ids remains intentionally deferred.

@snyk-io

snyk-io Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

1 participant