When I use the afterUpdate lifecycle, the query to the API does not return a response until this lifecycle hook is completed. My afterUpdate lifecycle hook takes roughly 50-60 seconds to complete so the UI freezes whilst the “Save” or “Publish” buttons are showing the loading animation.
When an afterUpdate lifecycle hook fails, the response fails. So I’m not confident the answers above about the response is already sent to the user before the lifecycle hook is triggered are accurate.
It would be great if I can either:
- Send back a response that will trigger an update to the UI (if this frontend logic is already implemented), OR
- Create frontend logic to refresh/update the data in the UI after every publish or save request