ualbertalib / jupiter

Jupiter is a University of Alberta Libraries-based initiative to create a sustainable and extensible digital asset management system. This is phase 2 (Digitization).
https://era.library.ualberta.ca/
MIT License
23 stars 10 forks source link

Download target changes after editing metadata #3248

Open pgwillia opened 1 year ago

pgwillia commented 1 year ago

Describe the bug

image

It links to https://era.library.ualberta.ca/items/b0368001-8f63-4786-b994-1cf88fcfc826/download/c2fc73ae-c3f3-4b9b-8113-4130ee04d290 which is not a thing, hence the 404.

The item looks fine https://era.library.ualberta.ca/items/b0368001-8f63-4786-b994-1cf88fcfc826 image

And the download is fine too https://era.library.ualberta.ca/items/b0368001-8f63-4786-b994-1cf88fcfc826/download/921733ec-d539-40b5-a564-835260a82ea2

So what seems to be happening is that when any edit is made to an item, the files are given new identifiers, invalidating any existing links, like the one in Google Scholar.

To Reproduce Steps to reproduce the behavior:

  1. Go to an item (any item)
  2. View the files in a separate tab
  3. Make an edit (doesn't seem to matter where the edit is made)
  4. Finish the wizard and click save
  5. Refresh the files being viewed in a separate tab. You'll notice that the target URL for downloads has a new identifier.

Expected behavior

Additional context Some oddity I could investigate is the metadata about the item we're displaying for google scholar. image

https://search.google.com/search-console/index?resource_id=https://era.library.ualberta.ca/&utm_source=wnc_20237597&utm_medium=gamma&utm_campaign=wnc_20237597&utm_content=msg_110624660&hl=en-CA has been reporting broken links image

pgwillia commented 1 year ago

I think the bug comes from line 159 where we assign a random fileset_uuid

https://github.com/ualbertalib/jupiter/blob/f04a470e2853cd0f375d0282fc438cd6912c27fe/app/models/draft_item.rb#L149-L160

But I think that demonstrates that we could restore the old uuid from Google Scholar.