Skip to content

feat(notifications): let apps open and resolve deduplicated incidents #593

Done

Description

@RentnerKev

Phase: 6 | Priority: P0

Let apps open, update and resolve deduplicated incidents in the platform's notification engine, delivered through the existing mail and webhook channels. Monitoring needs this to keep outage notifications after RentnerProxy/app-monitoring#1, and later apps such as CrowdSec can use the same capability.

Current state

  • notifications.publish.v1 stores rows in app_runtime_messages and emits an event on the app's own stream (web/src/server/AppRuntime/messages.server.ts). Nothing reaches the incident engine or mail and webhook delivery.
  • The built-in host_availability category is wired to host_check_policies: reconciliation on every collection commit and delivery claim, delivery authorization, validation and the mail template (web/src/server/Notifications/host-availability*.ts, incident-engine.ts, notification-repository.ts, web/src/server/Mail/notification-template.ts).

Scope

  • A new capability for app incidents, keyed by an app-chosen incident key, with a resource reference (for example a proxy host ID), severity and plain text fields. Every call is idempotent by key.
  • The engine handles app incidents generically: deduplication per installation and key, cancellation of superseded incidents, subscriptions per app category, delivery through the existing channels.
  • The platform renders mail and webhook payloads from length-limited plain fields. Apps cannot inject HTML or links.
  • Delivery authorization rechecks the referenced resource for each recipient (for example PROXY_HOSTS_VIEW for a host) and the app's grant for that resource.
  • Stopping or uninstalling the app resolves its open incidents with an explicit reason. After a restore, stale outage alerts are suppressed, as pausedAfterRestore does today.
  • The built-in host_availability category stays until the monitoring handoff commits.

Dependencies

Acceptance criteria

  • An app with the grant can open, update and resolve an incident. Repeated and retried calls with the same key never duplicate an incident or a delivery.
  • Mail and webhook channels deliver app incidents only to subscribed users who may see the referenced resource.
  • App text is plain and length-limited and is rendered in platform templates.
  • Disabling or uninstalling the app resolves its open incidents with an explicit reason. A restore does not replay stale outage alerts.
  • Without the grant the endpoint refuses, and notifications.publish.v1 behaves as before.

Tracked by RentnerProxy/app-monitoring#1 and #460.
Use focused project checks and short integration/recovery tests. Endurance runs belong to release preparation.

Activity

  1. added this to the v1.0.0-beta.4 milestone on Nov 26, 2026
  2. added
    enhancement
    security
    area: runtime
    on Nov 26, 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

    area: runtimeenhancementsecurity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions