Closed amyehodge closed 3 years ago
In trying to reproduce this error, I ran into something different: the deposit failed (because an invalid cocina model was generated, per @jcoyne on slack as well as me in this comment on the original PR). Then, because no state transitions existed that allowed update_metadata
before deposit was complete (which would get the WorkVersion
to purl_reserved
), I was unable to select a type for my wedged PURL reservation (I could get the modal, but I'd get bounced back to the dashboard when selecting a type, and my selection wouldn't apply).
StateMachines::InvalidTransition: Cannot transition state via :update_metadata from :reserving_purl (Reason(s): State cannot transition via "update metadata")
)Dry::Struct::Error: [Cocina::Models::RequestDRO.new] "n/a" (String) has invalid type for :type violates constraints (included_in?(["http://cocina.sul.stanford.edu/models/object.jsonld", "http://cocina.sul.stanford.edu/models/3d.jsonld", "http://cocina.sul.stanford.edu/models/agreement.jsonld", "http://cocina.sul.stanford.edu/models/book.jsonld", "http://cocina.sul.stanford.edu/models/document.jsonld", "http://cocina.sul.stanford.edu/models/geo.jsonld", "http://cocina.sul.stanford.edu/models/image.jsonld", "http://cocina.sul.stanford.edu/models/page.jsonld", "http://cocina.sul.stanford.edu/models/photograph.jsonld", "http://cocina.sul.stanford.edu/models/manuscript.jsonld", "http://cocina.sul.stanford.edu/models/map.jsonld", "http://cocina.sul.stanford.edu/models/media.jsonld", "http://cocina.sul.stanford.edu/models/track.jsonld", "http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld", "http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld"], "n/a") failed)
i have a WIP PR to address the issue i encountered: #1202
@jmartin-sul I just tested this again and I am not seeing that error. Hooray!
However, is there any way to keep the page from returning all the way to the top when it reloads? When there is a lot on the page it's hard to find where it was I made the PURL. But this is minor and not something a lot of time should be spent on. Just thought I'd ask.
The second one I reserved seems not to be updating with the actual PURL even after a couple of minutes and a manual page refresh:
The second one I reserved seems not to be updating with the actual PURL even after a couple of minutes and a manual page refresh:
@amyehodge it looks like I (initially) forgot to restart the sneakers based workers when i deployed my test branch.
I restarted them, and my test objects from before the restart did not correctly get put into the purl reserved state (because the worker didn't pick up the old job and fire the deposit complete event on them). But the test object i created after restarting the workers did seem to successfully have the deposit complete event fired on it, and it did end up automatically getting marked as "PURL Reserved". I was then able to click the pencil icon, select a type, and edit metadata. I was also able to go to the PURL for that last test object (the PURL didn't work for the first two, from before the restart, but those druids were available in Argo).
Would you mind trying a PURL reservation again when you get a chance? And selecting a type and editing metadata? Thanks!
@jmartin-sul I just tested this again and I am not seeing that error. Hooray!
However, is there any way to keep the page from returning all the way to the top when it reloads? When there is a lot on the page it's hard to find where it was I made the PURL. But this is minor and not something a lot of time should be spent on. Just thought I'd ask.
Hmm, definitely possible, but it'd require re-working the form submission to be more AJAX-y, and off-hand, I'm not sure exactly how I'd approach it. Would you mind filing a ticket?
@amyehodge i may have spoken too soon -- one of my PURL reservation tests worked completely automatically with no manual intervention. but the two i tried after that have not had the deposit_complete event fired on them automatically, and so they're stuck in the "Reserving PURL" (reserving_purl
) state. i'm not sure if this is an issue with me not re-starting the sneakers workers properly, or something else. when i refreshed the page manually in those cases, i did at least see a PURL.
this does still seem like an improvement over what's currently on main
.
When trying to reserve a PURL on an H2-created collection, I entered a title and clicked Submit, and it loaded the work edit page (which I don’t understand) and reported this error:
Then when I tried to reserve a PURL on a migrated collection, it didn't open the form (this seems right) and appeared to reload the dashboard, but I didn’t see the reserved item listed in the collection. And I appeared to have triggered this in HB:
line 53 of [PROJECT_ROOT]/app/forms/draft_work_form.rb: deserialize_embargo line 41 of [PROJECT_ROOT]/app/forms/draft_work_form.rb: deserialize! line 35 of [PROJECT_ROOT]/app/controllers/works_controller.rb: create
https://app.honeybadger.io/projects/77112/faults/76941540