Closed
Description
Per discussions with @lindyhopchris on Slack:
on a PATCH request, this package serializes the model to its JSON:API representation before validation occurs, so that we can give the validator the current values of anything that hasn't been sent in the request.
This causes the model to cache the relationship in it's pre-patched state so when the model then later gets serialized for the response, it's got stale data in its relationship cache.
The only fix, is to $model->refresh()
in the updated hook on the controller.
If possible, we need to always refresh the model to be sure that the package has non-stale data.