-
Notifications
You must be signed in to change notification settings - Fork 21
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
🧹 Make CreateRelationshipJob work for Valkyrie #908
Merged
ShanaLMoore
merged 4 commits into
hyrax-4-valkyrie-support
from
hyrax-4-valkyrie-support-transactions-in-relationships-job
Feb 2, 2024
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ class ActiveFedoraAdapter < AbstractAdapter | |
def self.find(id) | ||
ActiveFedora::Base.find(id) | ||
rescue ActiveFedora::ObjectNotFoundError => e | ||
raise PersistenceLayer::RecordNotFound, e.message | ||
raise PersistenceLayer::ObjectNotFoundError, e.message | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! |
||
end | ||
|
||
def self.query(q, **kwargs) | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm curious about this choice. won't this ensure that the entire update work process (the same one that happens via the controller action) takes place just to change the work membership?
Hyrax::Publisher provides an
object.membership.updated
event, and i wonder whether it wouldn't be better to save the work with the updated membership and publish that? https://github.com/samvera/hyrax/blob/fdcabe651850b1885d7bd3e1b36777bf5f336ee8/lib/hyrax/publisher.rb#L183-L192There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@no-reply, for our uses, we're trying to hit this transaction, so you're suggesting we put a publisher here and then that means this can become a listener?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here was the original idea of the listener
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirkkwang yes. i think what i'm suggesting (and i'm just popping in as an outsider here), is that you want this behavior to trigger whenever an object's membership changes, not only when a given transaction runs.
making it a
listener
means you'll trigger these changes when outside callers (in Hyrax or in the downstream application) change membership, as long as they dutifully publish the expected message.i think a helpful line to draw around transactions and listeners is:
current_user
as the "depositor" every time acreate
action happens in the hyrax works controller, but handle this matter differently if i create an object through an API endpoint.another way of thinking about it is:
do_this; do_that; do_other
, then you want that to be a transaction step.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @no-reply that's super helpful!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I made a ticket here scientist-softserv/iiif_print#330
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@no-reply should this publish
'object.membership.updated'