hapi-fhir icon indicating copy to clipboard operation
hapi-fhir copied to clipboard

$delete-expunge does not invoke BinaryStorageInterceptor.expungeResource via Pointcut

Open ttnTrifork opened this issue 1 year ago • 1 comments

Hi

BinaryStorageInterceptor has this hook which is very nice, as it expunges externalized binaries:

@Hook(Pointcut.STORAGE_PRESTORAGE_EXPUNGE_RESOURCE)
public void expungeResource(AtomicInteger theCounter, IBaseResource theResource) { ...

However, this is not invoked during $delete-expunge (in the DeleteExpungeSvcImpl). $delete-expunge only calls Pointcut.STORAGE_PRE_DELETE_EXPUNGE before submitting the job, which BinaryStorageInterceptor doesn't react to.

It would be very useful if both the "main" resources targeted by the URL parameter in a $delete-expunge and the cascaded resources was processed by BinaryStorageInterceptor.expungeResource. (also processing cascaded delete-expunges is very important to make the cascade parameter useful and trustworthy)

I am not sure if its easier to update BinaryStorageInterceptor to react to Pointcut.STORAGE_PRE_DELETE_EXPUNGE or invoke the Pointcut.STORAGE_PRESTORAGE_EXPUNGE_RESOURCE for each resource being expunged (including cascaded)

ttnTrifork avatar Mar 20 '24 20:03 ttnTrifork

Its an issue on 6.8.x, 6.10.x and probably also 7.0.x and master branch

jkiddo avatar Mar 21 '24 09:03 jkiddo