🐛 Remove subtle timing error in ActorStack coercion #6670
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, the order of operations was:
env.curation_concern.valkyrie_resource
)The subtle bug is that the curation_concern's valkyrie resource would have an out of sync access control. Why, because we're relying on logic elsewhere (e.g. Hyrax::ModelConverter) to assign the permissions.
In v5.0.0 and prior we're copying the current curation concern's permissions to the valkyrie permission; this happens before we save. See implementation.
However, this can create issues depending on metadata adapter configuration; in particular when we update the ACL object for a record without updating the record; something that we see happening in the Frigg and Freyja adapters, but is also not limited to those adapters.
Also, consider that we likely want to remove a timing of parameters; because when reading method call, we (or at least I) mentally treat the parameters we pass as order independent. Put another way, the parameters we pass should likely not change state of each other.
@samvera/hyrax-code-reviewers