-
Notifications
You must be signed in to change notification settings - Fork 363
fix: Clean up notification effect [DHIS2-17243] #17936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...his-service-program-rule/src/main/java/org/hisp/dhis/programrule/api/NotificationEffect.java
Outdated
Show resolved
Hide resolved
...his-service-program-rule/src/main/java/org/hisp/dhis/programrule/api/NotificationEffect.java
Outdated
Show resolved
Hide resolved
...his-service-program-rule/src/main/java/org/hisp/dhis/programrule/api/NotificationEffect.java
Outdated
Show resolved
Hide resolved
...dhis-service-program-rule/src/main/java/org/hisp/dhis/programrule/api/RuleEngineEffects.java
Outdated
Show resolved
Hide resolved
...dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/job/NotificationSender.java
Outdated
Show resolved
Hide resolved
|
||
programNotificationInstanceService.save(notificationInstance); | ||
|
||
log.info(String.format(LOG_MESSAGE, template.getUid())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging should be done using parameterized messages https://www.slf4j.org/faq.html#logging_performance
Should that be an info log? To me this is debug. We log to much IMHO. This is why we have the logging group combing through logs 😅
Ask yourself who would want to see this and what should they do with it? Logs should be actionable by the operator of DHIS2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enricocolasante I think we should still address this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just removed it.
I think it didn't really make any sense to log a scheduled notification and not the sent one.
Scheduled notifications are saved somewhere in the system. If there is any need to debug it will be better to check the DB or the endpoint if we have one to understand what happened
...dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/job/NotificationSender.java
Outdated
Show resolved
Hide resolved
...dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/job/NotificationSender.java
Outdated
Show resolved
Hide resolved
...dhis-service-program-rule/src/main/java/org/hisp/dhis/programrule/api/RuleEngineEffects.java
Outdated
Show resolved
Hide resolved
...service-tracker/src/main/java/org/hisp/dhis/tracker/imports/DefaultTrackerImportService.java
Outdated
Show resolved
Hide resolved
@@ -92,7 +93,7 @@ | |||
return entityReport.stream().flatMap(e -> e.getErrorReports().stream()).toList(); | |||
} | |||
|
|||
public List<TrackerSideEffectDataBundle> getSideEffectDataBundles() { | |||
return sideEffectDataBundles; | |||
public List<TrackerNotificationDataBundle> getNotificationDataBundles() { |
Check notice
Code scanning / CodeQL
Exposing internal representation Note
after this call to getNotificationDataBundles
getNotificationDataBundles exposes the internal representation stored in field notificationDataBundles. The value may be modified after this call to getNotificationDataBundles.
|
Notification effects can be simplified and shaped in a better way to be handled in tracker.
NotificationEffect
to hold all and only the relevant information to correctly handle notifications. Removed the type and ruleUid.RuleActionScheduleMessageImplementer
andRuleActionSendMessageImplementer
and createNotificationSender
that will send the notification if no date is provided or schedule the notification on the provided date.