Repository navigation
Write the Alert Dispatched event when an alert value is null - #573
Merged
tonygermano merged 2 commits intoNov 17, 2026
Merged
tonygermano merged 2 commits into
tonygermano merged 2 commits into
Conversation
pacmano1
requested review from
a team,
NicoPiel,
gibson9583,
jonbartels,
kayyagari,
kpalang,
ssrowe and
tonygermano
November 11, 2026 18:36
mgaffigan
previously approved these changes
Nov 11, 2026
tonygermano
previously approved these changes
Nov 12, 2026
Member
|
@pacmano1 I already approved, but can you add a release note section to the bottom of the PR description? |
Contributor
Author
|
Added. |
jonbartels
requested changes
Nov 13, 2026
jonbartels
left a comment
Contributor
There was a problem hiding this comment.
Logging improvement. I hate to reject the PR for it but a clear log will help a lot in the event that this does throw.
A question or nit - The "How to verify" section describes a channel setup that would validate the issue. Should this be a smoke test channel? I am leaning "no" since the unit test seems sufficient
tonygermano
approved these changes
Nov 14, 2026
gibson9583
approved these changes
Nov 16, 2026
jonbartels
approved these changes
Nov 17, 2026
AlertWorker.ActionTask built the event by calling toString() on every alert context value, so a null value threw after the alert's actions had gone out. Nothing reads the task's Future, so the event was dropped and nothing was logged. A blank server name (since OpenIntegrationEngine#259) and a null connector type (source transformer errors, alerts.sendAlert) both hit it. Null values now become empty attributes, as AuthorizationController does for audit events, and a failure in the event step is logged like the protocol and email steps already are. Closes OpenIntegrationEngine#572 Signed-off-by: Finnegan's Owner <[email protected]> Co-Authored-By: Claude <[email protected]>
If writing the Alert Dispatched event fails, the error now says which alert it was, as "name" (id), the way the engine names channels in its log lines. The exception is still attached. Signed-off-by: Finnegan's Owner <[email protected]> Co-Authored-By: Claude <[email protected]>
tonygermano
force-pushed
the
fix/572-alert-dispatched-null
branch
from
November 17, 2026 13:52
7f9ca4f to
d0459d3
Compare
kryskool
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #572.
When an alert fires, its actions go out first. Then
AlertWorker.ActionTaskbuilds the "Alert Dispatched" event by callingtoString()on every value in the alert's context. A null value throws, and the task runs on an executor whoseFuturenobody reads, so the event is never written and nothing is logged.It's not only the server name. A source transformer that throws, or a call to
alerts.sendAlert(...), leavesconnectorTypenull, and those alerts never wrote the event either, server name or not. Measured below.The blank server name case is courtesy of #259, which put
serverNamein the context. Tony spotted the null in review, wrote a nice paragraph about it, and it still collected three approvals, with #47 lined up to fill it in. #47 is still lined up. In fairness, thetoString()loop that actually throws has been sitting there since Mirth.Change
Objects.toString(value, "").AuthorizationControllerdoes the same for audit events, and empty is also what the feat: add serverName variable on alert template #259 thread wanted for the template variable.logger.errorthe protocol and email steps in that method already have, so if it breaks again it says so.${serverName}still renders as the literal token, as discussed in feat: add serverName variable on alert template #259, and so does${connectorType}on transformer andalerts.sendAlertalerts. Checked on an engine built from this branch.alerts.sendAlert, and any alert on a server with no name, will start writing an "Alert Dispatched" event per action. They never did before. Each one carries the full error text inerroranderrorMessage, same as the events that were already being written.AlertWorkerTestcovers a null server name and connector type, a set server name, and a failing dispatch getting logged. The first and the last fail on main.How to verify
Fresh engine on Derby, no server name set (Settings, Server, Server Name empty).
throw new Error('boom');.throw new Error('transformer boom');, any destination.Before: "Receiver" gets both alert messages, but neither "Alert Dispatched" event is written, and mirth.log says nothing about it. After: both events are there, with
serverNameblank on the first andconnectorTypeblank on the second.Tested
./gradlew clean build -x signSetupJars: 913 tests, 0 failures, 0 skipped.Live on Derby, one engine built from main (cd802ef) and one from this branch, one message per row:
serverNameblankconnectorTypeblankalerts.sendAlert(...)connectorTypeblankOn main, mirth.log has nothing about the three missing events. On this branch the new error line never shows up, since nothing failed.
Release Note
The "Alert Dispatched" event is no longer skipped when an alert value is missing
When an alert fired, its actions went out, but the "Alert Dispatched" event wasn't written if one of the alert's values was missing, and nothing was logged. That happened for any error alert while Settings, Server, Server Name was blank, and for alerts on source transformer errors or
alerts.sendAlert(...), which carry no connector type. The event is now written with those values as empty attributes, and a failure to write it is logged. (#572, #573)After upgrading, installs with such alerts will see "Alert Dispatched" events they didn't get before. Alert templates are unchanged: with no server name set,
${serverName}still renders as the literal${serverName}.Co-authored with Claude Code.