Skip to content

feat(apps): rate-limit app incident changes so a flapping app cannot crowd out alerts #666

Backlog

Description

@RentnerKev

Problem

  • setAppRuntimeIncidentInTransaction (web/src/server/AppRuntime/incidents.server.ts:136-230) has no cooldown or flap suppression. Each change locks the installation row (:145).
  • Existing limits: open incidents per installation (web/src/server/Notifications/app-incidents.ts:192-198), a global dispatch rate of 16 (web/src/config/notifications.config.ts:57) and 256 delivery slots. When all slots are taken, reserveNotificationDeliverySlot refuses (web/src/server/Notifications/incident-engine.ts:267-273), so an app with notifications.incidents.manage.v1 that flaps quickly could crowd out other alerts.
  • Quotas are asymmetric: the message count includes incidents (messages.server.ts:44, :72-76), the incident count does not include messages (incidents.server.ts:151-154, :212-217).

Proposal

  • Per app and incident: a minimum interval between state changes, coalescing changes inside the window, and flap detection that holds the incident open.
  • Reserve delivery capacity for platform alerts.
  • Keep separate quotas: incidents no longer count against the audit message quota.

Decision (2026-12-01)

Audit messages and incidents get separate quotas, so an app with many incidents cannot crowd out its own audit trail.

Acceptance

  • Test: an app toggling an incident 100 times per minute produces a bounded number of deliveries, and a platform alert is still delivered.

Found in the app platform audit of 2026-11-30.

Activity

  1. added
    enhancement
    area: runtime
    on Nov 30, 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: runtimeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions