You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HandleBeforeLinkSave method returns old linked entity [DATAREST-1241] #1600
In case of a PATCH or POST call, the linked object is a PersistentSet with both old and new values as these are augmenting HTTP methods.
But in case of a PUT call, the linked object is a PersistentSet with only old value. The new value passed in the request is not accessible. This makes it impossible to perform validations and/or business logic based on the new value of linked object.
Currently I am not aware of any workarounds to this issue.
After inspecting the Spring Data Rest code I think the following line in RepositoryPropertyReferenceController.java:
I'm being bitten by the same issue, which makes it impossible for me to handle the created application event and send a websocket message with all the needed info. I had independently thought of the same solution presented in the main ticket, and it also applies to link delete events
+1 I stumbled over the same problem. Looks like the code has changed in current version of spring. Now it looks like that @HandleBeforeLinkSave annotated method receives the NEW value as second parameter. And only the new value when POSTing
Activity
spring-projects-issues commentedon Sep 20, 2018
mathomas commented
I'm being bitten by the same issue, which makes it impossible for me to handle the created application event and send a websocket message with all the needed info. I had independently thought of the same solution presented in the main ticket, and it also applies to link delete events
spring-projects-issues commentedon Jun 20, 2019
Doogiemuc commented
+1 I stumbled over the same problem. Looks like the code has changed in current version of spring. Now it looks like that
@HandleBeforeLinkSaveannotated method receives the NEW value as second parameter. And only the new value when POSTingamnonkhen commentedon Dec 8, 2021
Is there any update on this? We are affected as well?
Publish link-save events with the value being saved.
Publish link-save events with the value being saved.