Skip to content

fix(alerts): register alert-notification kinds presets so ANS alerts fire - #1503

Merged
jung-thomas merged 1 commit into
mainfrom
fix/alert-notification-kinds
Aug 6, 2026
Merged

fix(alerts): register alert-notification kinds presets so ANS alerts fire#1503
jung-thomas merged 1 commit into
mainfrom
fix/alert-notification-kinds

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Why no alerts have ever arrived

We wired BTP Alert Notification (deploy start/finish/fail + admin test-alert), the managed alert-notification instance is bound to the live PROD srv, ChatSettings.alertsEnabled is on, and severity routing is correct — yet not one alert has been delivered.

Root cause is a plugin bug: @sap-tutorials/cds-alert-notification's cds-plugin.js sets cds.requires.alerts.kind but never registers the matching cds.requires.kinds presets. CAP resolves a requires.<svc>.kind against cds.requires.kinds before any on('connect') handler runs, so cds.connect.to('alerts') throws:

No configuration found for 'cds.requires.alert-notification'

Reproduced deterministically in all three profiles (prod alert-notification, dev -console, test -memory).

  • Deploy alerts flow through alerting.raise(), whose catch is deliberately fail-open — it swallowed this connect failure every time. Hence the silence.
  • The admin "Send test alert" button flows through raiseTest(), which surfaces the failure — that's the PROD error we saw.

Fix

Add a cds.requires.kinds block registering the three sink kinds against the plugin impl. This unblocks PROD on the next srv deploy without waiting on the upstream plugin release.

Verified with the real @sap/cds + plugin loaded: production kind=alert-notification now resolves (preset FOUND); all four profiles (prod/dev/test/hybrid) resolve.

Upstream

The proper home for this is the plugin itself — companion PR: sap-tutorials/cds-alert-notification#2 (v1.0.1) registers the presets + a regression test. This consumer-side block is the belt to that suspenders and can stay as a defensive override even after the plugin bumps.

Deploy note

Requires a full srv deploy (npm run deploy -- --env prod) to take effect — config-only change, no schema/build impact.

…olves

cds.connect.to('alerts') throws 'No configuration found for
cds.requires.alert-notification' because the @sap-tutorials/cds-alert-notification
plugin sets requires.alerts.kind but never registers the matching
cds.requires.kinds presets. CAP resolves the kind BEFORE the plugin's
on('connect') handler runs, so the service was unreachable in every
profile — no deploy-lifecycle alert has ever been delivered (raise() is
fail-open and swallowed the error; the admin test-alert surfaces it).

Add the kinds block to cds.requires so the consumer resolves now, ahead
of the upstream plugin fix (cds-alert-notification#2, v1.0.1).
@jung-thomas
jung-thomas merged commit af65aa4 into main Aug 6, 2026
5 checks passed
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