-
Notifications
You must be signed in to change notification settings - Fork 157
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
NullPointerException when deleting resource with fhir-smart enabled. #3276
Comments
I have created a PR with possible fix: #3292 |
Thanks @jornvanwier for the good bug report. We'd like to get this in for our next release. If you'd like to take a stab at the implementation, we can provide some guidance as needed. Otherwise, we can take this one. Let us know. P.S. There's been a number of changes in this area recently, so be sure to work from the latest on main. |
Hi Lee, I'd like to give the implementation a try. Currently, a resource with the new versionId and lastUpdated is created after the |
Hi @jornvanwier, yes I think that will work. Something like:
|
…nt in FHIRRestHelper (#3305) * Set both resource and prevResource for beforeDelete event Signed-off-by: Jorn van Wier <mail@jornvanwier.com> * No need to set event resource twice in doDelete Signed-off-by: Jorn van Wier <mail@jornvanwier.com>
Confirmed successful deletion of resources with fhir-smart enabled. |
Describe the bug
When the
fhir-smart
interceptor is enabled, deleting a resource gives aNullPointerException
.I did some digging, and I see that in the AuthzPolicyEnforcementPersistenceInterceptor it uses
event.getPrevFhirResource
to determine to resource being deleted, but in FHIRRestHelper onlyevent.setFhirResource
is called, notevent.setPrevFhirResource
.I was able to successfully delete a resource after modifying the code to call
event.setPrevFhirResource
in thedoDelete
method ofFHIRRestHelper
. Alternatively, I believe thebeforeDelete
method inAuthzPolicyEnforcementPersistenceInterceptor
could also useevent.getFhirResource
instead ofevent.getPrevFhirResource
.Environment
4.10.2
To Reproduce
Steps to reproduce the behavior:
patient/Observation.*
scope.{"resourceType":"OperationOutcome","issue":[{"severity":"fatal","code":"exception","details":{"text":"NullPointerException: resource"}}]}
Expected behavior
The resource should be deleted, and no
NullPointerException
should occur.The text was updated successfully, but these errors were encountered: