Skip to content
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

Universal Viewer does not show new file version #2910

Closed
julesies opened this issue Apr 10, 2018 · 6 comments · Fixed by #3764
Closed

Universal Viewer does not show new file version #2910

julesies opened this issue Apr 10, 2018 · 6 comments · Fixed by #3764

Comments

@julesies
Copy link

There are lots of comments in the nurax ticket about how to solve this problem please see the comments: samvera-labs/nurax-pre2023#253

Descriptive summary

Reporting for
Testing for Hyrax 2.1.0 beta 2
Browser: Chrome 65.0.3325.181 (32-bit)

Descriptive Summary
Example: https://nurax.curationexperts.com/concern/generic_works/db78tc05q?locale=en#?c=0&m=0&s=0&cv=0&xywh=-319%2C-3%2C1273%2C438

I have created a public work and attached an image (rubber duck in the linked example). I would like to upload a new version of the image. I click on the image title in the "Items" section, then "Edit this image", then the Versions tab to upload a new version. After uploading a new version (Old well in the linked example), I navigate back to the Work page. The Universal Viewer still displays the old image. The thumbnail in the Items section displays the new image. I can download the new image.

@julesies julesies added this to the 2.x series milestone Apr 10, 2018
@elrayle elrayle added this to Blocking - top priority in 2.1.0 Release Apr 11, 2018
@cjcolvar cjcolvar moved this from Blocking - top priority to In Progress - needs feedback/blocked in 2.1.0 Release Apr 17, 2018
@cjcolvar cjcolvar moved this from In Progress - needs feedback/blocked to In Progress - active dev in 2.1.0 Release Apr 17, 2018
@vantuyls vantuyls removed the blocker label Apr 17, 2018
@cjcolvar cjcolvar removed their assignment Apr 18, 2018
@cjcolvar cjcolvar moved this from In Progress - active dev to Blocking - top priority in 2.1.0 Release Apr 18, 2018
@cjcolvar cjcolvar moved this from Blocking - top priority to Blocking - triage in 2.1.0 Release Apr 18, 2018
@cjcolvar cjcolvar moved this from Blocking - triage to Blocking - top priority in 2.1.0 Release Apr 18, 2018
@elrayle elrayle removed this from Blocking - top priority in 2.1.0 Release May 1, 2018
@no-reply no-reply added this to Backlog in Hyrax WG -- Sprint 1 Jun 9, 2018
@vantuyls vantuyls moved this from Backlog to Ready in Hyrax WG -- Sprint 1 Jun 26, 2018
@dlpierce dlpierce self-assigned this Jul 9, 2018
@dlpierce dlpierce moved this from Ready to In progress in Hyrax WG -- Sprint 1 Jul 9, 2018
@dlpierce
Copy link
Contributor

I've got some still WIP code that adds "fcr:versions/version{n}" to the URI in the manifest and ultimately fetched by riiif. I hit a snag with the specs and encoding of the colon, but have found the issue (the ActionDispatch and CGI modules have different end results) so this should be very close to done.

@dlpierce dlpierce moved this from In progress to Review in Hyrax WG -- Sprint 1 Jul 24, 2018
@no-reply no-reply added this to In progress in Hyrax WG -- Sprint 4 Oct 1, 2018
@no-reply no-reply moved this from In progress to Ready in Hyrax WG -- Sprint 4 Oct 1, 2018
@vantuyls vantuyls added this to Ready in Hyrax WG -- Sprint 5 Oct 29, 2018
@chrisdaaz chrisdaaz added this to Backlog in Hyrax 3.0.0 Release Nov 27, 2018
@chrisdaaz chrisdaaz moved this from Backlog to In Progress in Hyrax 3.0.0 Release Nov 27, 2018
@ghost ghost self-assigned this Mar 20, 2019
@orangewolf
Copy link
Member

This is a much better solution than my cache busting code. @geekscruff @dlpierce anything I can do the help get this over the line?

@dlpierce
Copy link
Contributor

@orangewolf There was a concern with including version info in the public URI. I've been working on an enhancement to riiif to allow it to recognize additional image information, such as a timestamp, and use that to improve the browser caching strategy (conditional get instead of fixed 1 year).

Aside from that, the actor stack should be checked that it correctly indexes the new file version, especially the characterization metadata.

@orangewolf
Copy link
Member

orangewolf commented Mar 29, 2019

@dlpierce the indexing seems correct to me, but in our experience you have 4 layers of caching problem:

  1. caching on disk to tmp/network_files
  2. Rails caching
  3. Browser caching
  4. Cloud based caching with things like Cloudflare

It sounds like your proposed solution fixes (3), though URI change would fix all 4 in one go. I saw the PR comments, and I wonder if it would be better to add something in the URI that is uniqish but is not a use readable version number?

What I'm doing right now is calling the following in the after_perform of the app/jobs/ingest_job.rb file:

    # Cache Clearing
    wrapper.file_set.files.each do |file|
      Rails.logger.debug("Removing File with id:#{file.id}")
      FileUtils.rm_rf(Rails.root.join('tmp', 'network_files', Digest::MD5.hexdigest(file.uri.to_s)))
    end
    Rails.cache.clear # TODO get precise here

That gets the job done for 1 & 2 above, but still requires waiting for 4 to expire and a hard refresh to solve 3. It also feels pretty ham fisted.

@ghost ghost removed their assignment Apr 15, 2019
@dlpierce dlpierce moved this from In Progress to Review in Hyrax 3.0.0 Release May 21, 2019
@kellyChex kellyChex moved this from Review to In Progress in Hyrax 3.0.0 Release Jul 9, 2019
@dlpierce dlpierce moved this from In Progress to Review in Hyrax 3.0.0 Release Jul 11, 2019
@dlpierce dlpierce moved this from Review to In Progress in Hyrax 3.0.0 Release Aug 9, 2019
@dlpierce dlpierce moved this from In Progress to Review in Hyrax 3.0.0 Release Sep 5, 2019
@jessicahilt jessicahilt moved this from Review to QA in Hyrax 3.0.0 Release Sep 10, 2019
@dlim87
Copy link

dlim87 commented Sep 10, 2019

I did a QA check on this and it mostly seems to be working. Editing a file with a new version generally replaced it in the viewer and the thumbnail.

There was one edgecase though: when updated with a file type that isn't renderable in the UV (a svg in this case), it displayed the expected empty "No preview available/download this file" prompt in the place of the viewer, but was still showing a thumbnail of the last version

@jeremyf
Copy link
Contributor

jeremyf commented Sep 15, 2020

I've reported the edge case (see #4521), and am closing this issue.

@jeremyf jeremyf closed this as completed Sep 15, 2020
@jeremyf jeremyf moved this from Ready to Done in Hyrax 3.0.0 Release Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in progress needs rework Story not complete and needs further action
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

10 participants