Closed mrdnctrk closed 2 weeks ago
Formatting check succeeded!
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
rel_7_6@57f4076
). Learn more about missing BASE report.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
In hapi fhir server, there are 2 InterceptorBroadcaster instances that could be used to call hooks when handling a request. The first Broadcaster is the one that could be associated JPA module, and the second broadcaster is the one that is optionally set in RequestDetails.
One issue I am fixing in this MR is that for pointcuts that return boolean types, the return value of the hooks associated with the Broadcaster set in RequestDetails were not taken into account.
The second issue I am fixing is specifically for
STORAGE_PRECHECK_FOR_CACHED_SEARCH
pointcut. This Pointcut returns boolean type. For pointcuts that return boolean type , we should be callingdoCallHooks
method instead of callingdoCallHooksAndReturnObject
, but that wasn't the case forSTORAGE_PRECHECK_FOR_CACHED_SEARCH
. The problem with callingdoCallHooksAndReturnObject
instead ofdoCallHooks
is thatdoCallHooksAndReturnObject
function doesn't call the hooks for the Broadcaster set in the RequestDetails if a hook associated with the JPA module returns a non-null value: see null check here. Since a boolean returning hook always returns a non-null value (true or false is not equal to null), then the Broadcaster set in the requestDetails is never called. So in this MR, I made a change to use doCallHooks when invokingSTORAGE_PRECHECK_FOR_CACHED_SEARCH
pointcut, so that the broadcaster set in the request details is invoked as well.closes: #6440