455 describes a problem where calling EventBus.publish() via (doCommitWork() helper methods) and passing in an empty list of sObjects generates internal error logs
This fix skips the EventBus.publish() call in the default SimpleDML implementation of the IDML interface when the supplied List<sObject> is empty, which mirrors the approach to used in SimpleDML.emptyRecycleBin()
No unit tests have been added here. I am struggling to find any valuable way to test this scenario. Calling EventBus.publish() with an empty list doesn't generate any exception, doesn't return any Database.SaveResult, or contribute to any limits. The only impact I can see is the absence of internal error logs.
455 describes a problem where calling
EventBus.publish()
via (doCommitWork() helper methods) and passing in an empty list of sObjects generates internal error logsEventBus.publish()
call in the defaultSimpleDML
implementation of theIDML
interface when the suppliedList<sObject>
is empty, which mirrors the approach to used inSimpleDML.emptyRecycleBin()
EventBus.publish()
with an empty list doesn't generate any exception, doesn't return anyDatabase.SaveResult
, or contribute to any limits. The only impact I can see is the absence of internal error logs.fixes apex-enterprise-patterns/fflib-apex-common#455
This change is![Reviewable](https://reviewable.io/review_button.svg)