Alert Dispatched event is not written while the server name is blank

Offen Anfängerfreundlich
#572 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java

Rechercherichtung

Lies Alert.java in Zeile 59 und AlertWorker.java etwa bei Zeile 212, wo im Issue steht, dass der Nullwert im Kontext dazu führt, dass die Ereigniserstellung fehlschlägt. Verfolge, wie ActionTask das Ereignis „Alert Dispatched“ erstellt, und prüfe, ob es verwandte Tests für Alerts mit nicht gesetztem Servernamen gibt. Reproduziere den Fall einer Neuinstallation und bestätige anschließend, dass das Ereignis ohne Ausnahme geschrieben wird, wenn der Servername leer ist, und serverName weiterhin enthält, wenn er gesetzt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

While the server name is blank (Settings, Server, Server Name, empty on a fresh install), alerts are sent but no "Alert Dispatched" event is written, and nothing is logged.

On 4.7.0, a fresh engine on Derby with nothing added:

  1. A channel whose JavaScript Writer destination throws (throw new Error('boom');), and a second channel to receive an alert's Channel action.
  2. An alert on any error of any channel, with a Channel action to the second channel.
  3. Send one message to the first channel. The destination errors and the alert's action delivers to the second channel. No "Alert Dispatched" event is written, and the log shows only the destination's own error.
  4. Set a Server Name and send another message. The action delivers again, and this time the event is written, with serverName among its attributes.

Alert.createContext puts serverName into the alert's context (Alert.java:59), and it is null until a name is set. AlertWorker.ActionTask.call() sends the actions, then builds the event by calling entry.getValue().toString() on every context value (AlertWorker.java:212), which throws on the null. The task runs through actionExecutor.submit(...) and nothing reads the returned Future, so the exception is not logged. Skipping null values when building the event, or using String.valueOf, looks like the fix; not tested.

Co-authored with Claude Code.

Vorherrschende Sprache
Java
Sterne
227
Forks
81
Ø Merge
6 T. 5 Std.
Gemergte PRs (30 T.)
26

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus OpenIntegrationEngine/engine

Alle Issues in OpenIntegrationEngine/engine

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.