Describe the bug
Sibling of #7233 / PR #7278, found by grepping the other notify templates for the same shape. Notification.java.template (template-application-events-java) stamps outcome: only when Mail.send throws:
// events/Notification.java.template
#foreach($load in $relationLoads)
${load.targetEntity}Entity ${load.local} = ... new ${load.targetEntity}Repository().findById(entity.${load.fkProperty}); // before the try
#end
...
try {
data = org.eclipse.dirigible.sdk.print.Print.render("${attachEntity}", language, ...); // try/finally, no catch
} finally { ... }
...
try {
Mail.send(from, new String[] {to}, ..., subject, parts);
stampNotifyOutcome(entity.${notifyOutcomeKeyProperty}, null);
} catch (Exception ex) {
stampNotifyOutcome(entity.${notifyOutcomeKeyProperty}, ex);
throw new RuntimeException("Failed to send notification ${name}", ex);
}
A relation load that throws (a connection blip, a repository refusing), a Print.render failure (a broken .print template, a missing CMS image past the size limit is soft but a parse error is not) or the report-attach path failing propagates out of onMessage with no stamp: the broker redelivers, the onError log line is the only trace, and the record's outcome: field stays empty - the "silent by construction" state #7023 introduced outcome: to remove, and -notifyFailed never fires, so event: { onNotifyFailed: ... } cannot react either. PR #7278 fixed exactly this for the schedule fan-out (Job.java.template:304-309 now stamps a load/render failure); the single-record listener did not get the same treatment. Transition.java.template and Send.java.template already open their try before the loads.
Expected
The relation loads and the attachment render sit inside the same try as the send in Notification.java.template, so every failure of the delivery attempt stamps failed: <reason> and raises -notifyFailed, exactly as the notify branch of Job.java.template does since #7278. A test that breaks the render (an unparsable .print) and asserts the stamp.
Describe the bug
Sibling of #7233 / PR #7278, found by grepping the other notify templates for the same shape.
Notification.java.template(template-application-events-java) stampsoutcome:only whenMail.sendthrows:A relation load that throws (a connection blip, a repository refusing), a
Print.renderfailure (a broken.printtemplate, a missing CMS image past the size limit is soft but a parse error is not) or the report-attach path failing propagates out ofonMessagewith no stamp: the broker redelivers, theonErrorlog line is the only trace, and the record'soutcome:field stays empty - the "silent by construction" state #7023 introducedoutcome:to remove, and-notifyFailednever fires, soevent: { onNotifyFailed: ... }cannot react either. PR #7278 fixed exactly this for the schedule fan-out (Job.java.template:304-309now stamps a load/render failure); the single-record listener did not get the same treatment.Transition.java.templateandSend.java.templatealready open their try before the loads.Expected
The relation loads and the attachment render sit inside the same
tryas the send inNotification.java.template, so every failure of the delivery attempt stampsfailed: <reason>and raises-notifyFailed, exactly as thenotifybranch ofJob.java.templatedoes since #7278. A test that breaks the render (an unparsable.print) and asserts the stamp.