Skip to content

Alert Dispatched event is not written when an alert value is null #572

Closed

Description

@pacmano1

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.

Activity

  1. ishwaryapriyavarthini commented on Nov 11, 2026

    @ishwaryapriyavarthini

    Hi! I’m interested in contributing to this issue as a beginner Java developer.

    I would like to investigate the null server name handling, implement a suitable fix, and add unit tests to verify the behaviour.

    Could you please confirm whether this issue is available for me to work on?

    Thank you!

  2. pacmano1 commented on Nov 11, 2026

    @pacmano1
    ContributorAuthor

    Thanks for offering. I'm already working on this one and will have a PR up shortly. Happy to have you review it once it's open.

  3. changed the title [-]Alert Dispatched event is not written while the server name is blank[/-] [+]Alert Dispatched event is not written when an alert value is null[/+] on Nov 11, 2026
  4. pacmano1 commented on Nov 11, 2026

    @pacmano1
    ContributorAuthor

    Measured on main (cd802ef): it's not only the server name. A source transformer that throws, or alerts.sendAlert(...), leaves connectorType null, and those alerts never write the event either, server name set or not. The alert action still goes out every time, and nothing is logged. Retitled to match.

    The server name part came in with #259. #47 would put an empty string in, but only for the server name.

    Fix in #573.

  5. added a commit that references this issue on Nov 17, 2026
    af47f02
  6. added a commit that references this issue on Nov 17, 2026
    89f1c03
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions